RFC: Listening for devices being added - udev vs. X11

Jannis Pohlmann jannis at xfce.org
Wed Apr 16 00:42:24 CEST 2014


On Tue, 15 Apr 2014 08:34:55 +0200
Maximilien Noal <noal.maximilien at gmail.com> wrote:

> Le 15/04/2014 05:38, Martin Kelly a écrit :
> > Hi,
> >
> > I'm working on a patch to fix a longstanding frustration I've had
> > with XFCE, which is that every time I unplug an external keyboard
> > and then plug it in again, my keyboard repeat settings get lost. It
> > is 100% reproducible and has a fairly simple explanation, which is
> > that xfsettingsd does not listen for the device being added, so X11
> > sets the keyboard repeat rate instead. Thus my patch is for
> > xfsettingsd to listen for keyboards being added and apply the
> > keyboard settings when the event fires.
> >
> > The question is: Should XFCE listen via udev or via xorg? Using
> > udev is definitely cleaner and more future-proof, but xfsettingsd
> > is already using many X11 libraries, so udev adds a new dependency. 
> > Especially since I am new to XFCE development, I wanted to get 
> > community feedback so I don't go down a path that will eventually
> > be rejected.

You can easily make udev (and therefor this feature) optional. That
should lower the risk of the patch(es) being rejected. But if there's
an X mechanism to monitor attach/detach events related to input devices
that could make sense as well. It depends a bit on how xfsettingsd
associates its keyboard/mouse settings with devices (e.g. which
device identifiers it uses, if any).

> I'm not a Xfce dev, but since Xorg is being replaced by Wayland,
> which Xfce will have to deal with sooner or later, and since udev
> isn't going away : not adding another Xorg dependency makes more sens
> to me.

It'll take a while until Wayland is ready for the desktop (yes, I am
aware there is work on desktop shells for Weston) and until toolkits
are fully ready for Wayland.

It's a good point however, udev is a fairly good mechanism to monitor
for device changes (we already use it in thunar/thunar-volman) and it's
the tool of choice in Wayland/Weston/libinput as well.

  - Jannis


More information about the Xfce4-dev mailing list