Hi Abhijeet,

Maybe adding in the condition someting like :
 if mouse.object_under_pointer() ~= c and mouse.screen = c.screen then
...
end

This way, your mouse will move to the focused window only if they are on
the same screen.

Best regards,
Alexis BRENON



Le Fri Nov 21 2014 at 09:00:14, Abhijeet Rastogi <abhijeet.1...@gmail.com>
a écrit :

> Hi everyone,,
>
> Right now, I've this small snipped in my rc.lua that makes the mouse
> focus to the center of newly opened window.
>
> client.connect_signal("focus", function(c)
>     if mouse.object_under_pointer() ~= c then
>         local geometry = c:geometry()
>         local x = geometry.x + geometry.width/2
>         local y = geometry.y + geometry.height/2
>         mouse.coords({x = x, y = y}, true)
>     end
> end)
>
> The problem with this is that, it also focuses to a window if it's in
> a separate "screen". I only want it to happen for current screen. How
> do I make this possible?
>
> I tried to add "c:isvisible()" as one more condition but for some
> reason it isn't working. I'm dealing with "IceadTea" java windows so
> support for it is already messy. Could that be the reason?
>
> --
> Cheers,
> Abhijeet Rastogi (shadyabhi)
>
> --
> To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.
>

Reply via email to