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:
Emmanuel Lepage Vallee 2016-08-22 01:52:49 -04:00
parent 5eab124677
commit abd3d55554
1 changed files with 11 additions and 0 deletions

11
box.lua
View File

@ -17,6 +17,17 @@ local function new(args)
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
end