[Geany-Devel] RFC: Keybindings rewrite

Thomas Martitz kugel at xxxxx
Thu Jul 10 06:24:51 UTC 2014


Am 08.06.2014 00:35, schrieb Colomban Wendling:
> Le 06/06/2014 16:17, Thomas Martitz a écrit :
>> Hello,
>>
>> based up on Matthew's fine GtkActions branch [1]
> We probably should not define the actions in the Glade file but rather
> in the code, they aren't really a UI thing but should reflect what the
> app can do basically.  Basically it's rather a replacement for our
> send_command() rather than simply keybindings.
>
>> I think we could
>> realistically rewrite keybindings.c use GtkAction/accelerators properly.
>>
>> Currently it re-implements lots of gtk stuff, such as the actual looping
>> through the known keybindings for the callback when a keybinding
>> pressed. When this would be rewritten keybindings.c could probably be
>> half as large (in LOC terms).
> Yes, current handmade keybinding is suboptimal, and GtkAction is
> probably a good idea.  However, we need to make sure it doesn't remove
> feature on the way, because we have some tricky handling in some cases
> AFAIK.
>


In reply to the removed-features part, and generally as an update, I 
wanted to tell that I basically suspended my work on this. I already 
converted keybindings half-way to GtkAction when I found that we allow 
keybindings to be mapped to multiple actions, and even do this by 
default for tab. Plus we allow those keybindings to be context sensitive 
in the sense that the handler function can tell that it didn't handle 
the keybinding in which case the next mapped keybinding-action will be run.

This is basically impossible to support with plain GtkActions, and 
therefore I stopped my work on this for the time being. If there's any 
interest in continuing and ideas how to resolve the above issue then 
please leave a comment.

Best regards


More information about the Devel mailing list