RFC: Listening for devices being added - udev vs. X11
Nick Schermer
nick at xfce.org
Mon Apr 21 21:53:01 CEST 2014
On Mon, Apr 21, 2014 at 3:40 PM, Martin Kelly <martin at martingkelly.com> wrote:
> Nick Schermer wrote:
>>
>> Thunar is different in is aspect since it is required to watch for
>> block/usb events, which is not possible through X, so there gudev
>> became optional.
>>
>> Keyboards are a different issue, it is easy to watch those with X and
>> should therefore be the preferred option. Look at the pointers code
>> (instead of IsXExtensionPointer use IsXExtensionKeyboard).
>> Advantage is you have the correct device too, which is probably needed
>> to set some of the properties as well.
>>
>> Nick
>>
>
> X is more optimal in supporting all platforms and not adding more
> dependencies. However, it's less feature-proof as any X-dependent code is
> eventually throwaway code. I have the gudev part of this working now. It
> sounds like the optimal solution here to balance this needs is to #ifdef the
> code to use gudev if it's present and fall back to X if not. My current code
> already has the #ifdef for gudev, so I just need to add an X case.
Udev == systemd, so for feature-proof I put my chips on X11 ;-). We
are talking about what, maybe 20 lines of code? I doubt it will be
much smaller in gudev, which is a new dependency for xfce4-settings.
That said, 2 paths (monitoring) leading to the same end result is a no
go, it will only lead to confusing bug reports.
So X11 is the only good option, unless it is impossible and gudev is required.
Nick
More information about the Xfce4-dev
mailing list