awful.layout: Move clients if a screen is moved

Fixes: https://github.com/awesomeWM/awesome/issues/976
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-07-24 16:36:03 +02:00
parent bdfc0c0d71
commit 6e8b4f99f8
1 changed files with 14 additions and 0 deletions

View File

@ -277,6 +277,20 @@ end
capi.client.connect_signal("request::geometry", layout.move_handler)
-- When a screen is moved, make (floating) clients follow it
capi.screen.connect_signal("property::geometry", function(s, old_geom)
local geom = s.geometry
local xshift = geom.x - old_geom.x
local yshift = geom.y - old_geom.y
for _, c in ipairs(capi.client.get(s)) do
local cgeom = c:geometry()
c:geometry({
x = cgeom.x + xshift,
y = cgeom.y + yshift
})
end
end)
return layout
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80