box: Set the screen if specified in the arguments
The old logic had some dark tricks to set this, but here is a clean solution.
This commit is contained in:
parent
2382d74801
commit
620588d189
11
box.lua
11
box.lua
|
@ -17,6 +17,17 @@ local function new(args)
|
||||||
|
|
||||||
w.placement = placement.centered
|
w.placement = placement.centered
|
||||||
|
|
||||||
|
if args.screen then
|
||||||
|
w.screen = args.screen
|
||||||
|
end
|
||||||
|
|
||||||
|
local s = w.screen
|
||||||
|
w:connect_signal("property::geometry", function()
|
||||||
|
if w.screen ~= s then
|
||||||
|
w:move_by_parent()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue