On 20 April 2012 17:30, Uli Schlachter <[email protected]> wrote: > On 20.04.2012 15:18, dodo wrote: >> On 18 April 2012 18:23, Uli Schlachter <[email protected]> wrote: >>> On 15.04.2012 04:53, dodo wrote: >>>> 2. add awful.keygrabber which would handle a stack and `route` the key >>>> events to the right widget. >>> >>> So you mean that instead of starting a keygrabber directly, I tell >>> awful.keygrabber that I want some specific key events and it starts a >>> keygrabber >>> as long as someone asks for key events? >>> Everyone who wants key events registers a callback and can signal "nope, >>> this >>> key event is not for me, pass it on"? >> >> not quite. you tell awful.keygrabber that you want keys but if someone >> after you asks for keys as well he will get it until he leaves it and >> you're back in key control again. >> the attachment might describe it in a better way than my words ^^ >> >> what do you think? > > Hm, I guess I do like this. Not sure if all the existing code returns the > right > values from its keygrabber function, but that can be looked into later.
in the awesome repo there is only awful.menu and awful.prompt that use the keygrabber. > For the patches at hand: This doesn't look like a proof-of-concept, but like a > finished patch that I should merge. Right? (I'd merge this!) ya, well .. its both :) .. its a working proof-of-concept. but i don't mind if you merge it. i was just curious if maybe somebody has an opinion about this, or even a better idea. > Patch 1 should make its private data "local". Perhaps even "grabber" and > "keygrabbing" instead of "data.grabber" and "data.keygrabbing". fixed. > Patch 2 looks a little big to me. I'm not sure why cur_menu was needed, but > I'd > like this to be split up into two patches, if that's not a problem. I don't > completely mind the current version either... :-) i don't think it makes much sense to split this into 2 patches because awful.menu would be broken between the patches. cur_menu was need to track the latest opened menu to send all key events to it. but now every submenu can haz its own keygrabber. the removal of cur_menu also fixes the bug when two menus are opened and then the last one gets closed. this time i made the commit description i little bit bigger ^^ -- dodo
0001-awful.keygrabber-capi.keygrabber-stack.patch
Description: Binary data
0002-use-awful.keygrabber-in-awful.menu.patch
Description: Binary data
0003-use-awful.keygrabber-in-awful.prompt.patch
Description: Binary data
0004-no-keygrabber-in-menubar-needed.patch
Description: Binary data
