Re: Global keybindings in GNOME



Nigel Tao wrote:

Would it make sense to have a single D-Bus service where tomboy,
deskbar, metacity, etc. (and don't forget our KDE friends) can just
say "notify me on <Alt>F12", or is that just total crack and should we
just have a traditionally linked libkeybinder instead?

metacity can't do this because its keybindings are not just "run some action on key press" - it relies on getting the implicit key grab and thus release events and so forth. i.e. it has to do the XGrabKey() itself.

Since the WM has by far the most global bindings and also needs to actually grab them, metacity historically has been responsible for GNOME's global bindings, e.g. it also sets up the panel's bindings and forwards them to the panel as required.

By putting the bindings in the one WM process the idea was to keep a centrally maintained global binding set.

Just having an API to register bindings doesn't really get you far; the X server already offers that API, it's called XGrabKey() and it fails if two apps try to use the same binding. So the question is what else would a D-Bus service offer.

Since bindings are a global resource really there are two options for avoiding conflict:
 - foist it off on users - when they install an offending app, a dialog
   comes up like "this app wants to bind F12. the desktop has already
   bound F12" then the user chooses F11 instead and a new dialog is all
   "such-and-such already has F11. try again!" and so forth...
   not good.
 - have a centrally maintained list of global bindings that don't
   conflict

The second I'd hope is what GNOME does at least, even if third party apps don't. The KISS way to do that is just the WM register them all, there may be more complex solutions also.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]