mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-24 18:58:33 +02:00
bindings: provide a security margin when moving mouse to corner
This commit is contained in:
parent
6dd938deb3
commit
d81bd1bb38
1 changed files with 6 additions and 3 deletions
|
@ -89,10 +89,13 @@ local toggle_urgent = toggle_window(awful.client.urgent.get)
|
|||
|
||||
-- Move mouse to the top left corner of the currently focused client
|
||||
local function move_mouse()
|
||||
if client.focus and client.focus.screen == mouse.screen then
|
||||
local c = client.focus
|
||||
local margin = 10
|
||||
if c and c.screen == mouse.screen then
|
||||
local cc = c:geometry()
|
||||
local _, x, y = awful.mouse.client.corner(nil, "top_left")
|
||||
if x and y then
|
||||
mouse.coords({ x = x, y = y }, true)
|
||||
if x and y and cc.width > margin * 2 and cc.height > margin * 2 then
|
||||
mouse.coords({ x = x + margin , y = y + margin }, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue