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:
parent
bdfc0c0d71
commit
6e8b4f99f8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue