From fa23f70a41285c9ffda6640e3a982d5ebe724266 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Fri, 17 Apr 2009 00:23:11 +0200 Subject: [PATCH] awesome: improve mouse warping. Avoid warping if the mouse is not over a client (we're probably clicking on the menu bar or similar). Signed-off-by: Pierre Habouzit --- config/awesome/rc.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 911ae13..f044cc1 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -467,11 +467,15 @@ end) -- (tag switch, new client, etc) awful.hooks.arrange.register(function (screen) local sel = client.focus + if not sel then sel = awful.client.focus.history.get(screen, 0) - if sel then client.focus = sel end + if not sel then return end + client.focus = sel end - if sel and sel ~= mouse.object_under_pointer() then + + local o = mouse.object_under_pointer() + if not o or (type(o) == "client" and o ~= sel) then local g = sel:geometry() mouse.coords { x = g.x + 5, y = g.y + 5 } -- 2.20.1