On Tue, Aug 18, 2009 at 10:29:48AM +0200, Julien Danjou wrote:
> Hi Joerg,
> 
> At 1250546522 time_t, Joerg Jaspert wrote:
> > I'm having a problem I currently can't find the solution for.
> > I want to turn off awesome s (3.3.2) attention to the mouse, as it is
> > annoying. Whenever the mouse moves between the two screens here,
> > awesomes attention also switches from screen 1 to 2 (or vice versa). Yet
> > the focused client stays on the other screen, *ONLY* the awesome
> > keybindings are now all on the other. (It also doesnt matter if the tag
> > on the other screen actually has any client or not currently).
> > 
> > Thats very annoying.
> 
> First of all, let me recall something that pops up once in a while:
> a screen does _not_ have focus. Never. A client can haz it, but not a
> screen. :-)
> 
> Then, what's disturbing you is that by default, the keybindings are done
> like this:
> 
>         awful.key({ modkey }, i,  
>                   function ()  
>                         local screen = mouse.screen 
>                         if tags[screen][i] then 
>                             awful.tag.viewonly(tags[screen][i]) 
>                         end 
>                   end), 
> 
> where 'i' is a a tag number.
> 
> It means that when you'll press modkey + 1, it will switch to the
> tag 1 of the screen the mouse is on (mouse.screen).
> 
> You can avoid that by modifying the line
>     local screen = mouse.screen
> with
>     local screen
>     if client.focus then screen = client.focus.screen else screen = 
> mouse.screen end

An even finer way to do that, would be to introduce a new "focus" module
or object, which would tell a few things like:

  - the screen that holds the focus,
  - the tag that holds the focus (if that makes sense),
  - the current client that has focus
  - ... and so on.

Let it be configurable with parameters to tell what the user intends to
have focus.  For example, for Joerg, he would want that the screen that
has focus is the screen from the currently focused client rather than
the screen with the mouse in it. I personally want exactly the opposite
;)

Also allow people to redefine/override the "focus" object/module
methods, and you'll have something very powerful.  Point is, you can,
having such a module, write all the awesome APIs abstracting away those
notions for the greater good. It's also perfectly backward compatible
for everyone, with greater flexibility.

Also, those methods should take as an argument, the "action" that asks
for what has focus. That allow to define the notion of "active" screen
differently for different actions, if that makes sense.

-- 
Intersec <http://www.intersec.com>
Pierre Habouzit <[email protected]>
Tél : +33 (0)1 5570 3346
Mob : +33 (0)6 1636 8131
Fax : +33 (0)1 5570 3332
37 Rue Pierre Lhomme
92400 Courbevoie

-- 
To unsubscribe, send mail to [email protected].

Reply via email to