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 <psyc...@znc.in> 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".

> 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"?

> 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 awesome-devel-unsubscr...@naquadah.org.

Reply via email to