On 18 April 2012 18:23, Uli Schlachter <[email protected]> wrote: > On 15.04.2012 04:53, dodo wrote: >> sorry, for the late response .. > > Sorry, too. My internet connection broke. :-( > >> On 26 March 2012 17:28, Uli Schlachter <[email protected]> wrote: > [...] >>> Dodo, why does awful.menu allow the functions for executing menu entries to >>> return false in which case the menu isn't closed? What bad would happen if >>> that >>> is removed? >> >> nothing bad would happen i guess ... >> but counter question first, why is the keygrabber global? why cant i >> attach key event handlers to a wibox? >> i mean wouldnt it make more sense to let the menu listen for key >> events on its wibox? >> when a sub menu opens it gets the focus, when a prompt opens it gets >> the focus and so on … >> and when they close the previous focus gets restored. >> >> its nice to have a global keygrabber, for locking the window manager >> or something, but not for widgets. X solves this already pretty well, >> so imho we should just use that. >> >> atm i see three different ways to solve this problem: >> >> 1. add key events to drawins (listen for all keys should be possible >> too) and use this for every widget. > > So this is the "make drawin focusable" approach. However, what is the > difference > between "I give the input focus to a drawin and thus all key events get sent > to > it" and "I start a keygrabber and all key events get sent to me"? Instead of > having to mess with "who gets to grab keys", we then have the problem of "who > gets the keyboard focus".
well, one solution to that problem would be just to use the order of the created drawins, which is not really optimal. to achieve this we could reuse the awful.client.focus.history code, but this means that we would use a stack again. so i guess this would be the same like point 2 but a magnitude of more complexity. i admit, this is not really the way to go :þ >> 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? >> 3. or we remove this little feature from awful.menu and forget about all >> this. >> >> -- thanks for asking, dodo >> >> ps there might be more ways to solve this problem :P > > 4. Close the menu if starting the keygrabber fails. That's kinda ugly but it > hides the problem pretty well. :-) > > Uli > -- > "In the beginning the Universe was created. This has made a lot of > people very angry and has been widely regarded as a bad move." > > -- > To unsubscribe, send mail to [email protected]. -- 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
