From 112e1cf0911ee4b563489244361df04b3c363d8a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 2 Aug 2012 15:46:43 +0200 Subject: [PATCH] signals: don't follow focus if a mouse button is pressed --- rc/signals.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rc/signals.lua b/rc/signals.lua index 05bdb24..8b2ab6e 100644 --- a/rc/signals.lua +++ b/rc/signals.lua @@ -35,9 +35,14 @@ client.add_signal("manage", -- If a window change its geometry, track it with the mouse c:add_signal("property::geometry", function() - if client.focus == c then - mouse_follow_focus(c) - end + -- Check if the current focused client is our + if client.focus ~=c then return end + -- Check that no button is pressed + local buttons = mouse.coords().buttons + for _, state in pairs(buttons) do + if state then return end + end + mouse_follow_focus(c) end) -- Setup icon if none exists