[Geany-devel] Super modifier in keybindings - Re: Strange Geany behavior

Nick Treleaven nick.treleaven at xxxxx
Tue Aug 11 11:14:51 UTC 2009


Hi,
Sorry for the delay.

On Fri, 31 Jul 2009 12:07:55 +1000
Lex Trotman <elextr at gmail.com> wrote:

> Ok, it may be a GTK bug, I'll describe whats going on & you can decide
> and tell GTK, I've had zero success dealing with them in the past.
> 
> Geany keybindings are captured by keybindings.c/on_key_press_event and
> don't go to GTK but all other keys go to GTK
> 
> When a keybinding is first set Geany does NOT set it as a GTK
> accelerator, but the above callback catches it and it works fine, and
> if the binding is a key with a modifier the unmodified keys go to GTK
> and work fine
> 
> When keybindings are loaded from file (ie when Geany is closed and
> re-opened) they are set as GTK accelerators but are still caught by
> on_key_press_event before GTK.  But if the binding is a key with a
> modifier the unmodified key goes to GTK which appears to erroneously
> interpret it as an accelerator if the modifier in the
> gtk_widget_set_accelerator was GDK_SUPER_MASK

Not quite understanding this, perhaps it's better if you report that ;-)

> 
> The reason you can't set super as a modifier may be that the default
> modifier mask is set to block it.  I don't know what sets it, mine is
> 1c00000d which allows super at 4000000 and thats the value when the
> accelerator is set and when the keypress event occurs.

Mine is 67108864, so should work.

> Why does Geany process the accelerators twice? Once in Geany and once

Because we haven't found an easy way to update accelerators during
runtime.

> in GTK.  It seems to me that keybindings don't actually need to be set
> as accelerators since on_key_press_event catches them all first, and
> that would work around the GTK problem.

Yes, but this provides handy information to the user so they don't need
to lookup the keybinding.

Regards,
Nick



More information about the Devel mailing list