From abd3d5555485f2c2ba7d3879bf3971adffb8eac2 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 22 Aug 2016 01:52:49 -0400 Subject: [PATCH] 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. --- box.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/box.lua b/box.lua index 8939f61..197b5cc 100644 --- a/box.lua +++ b/box.lua @@ -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