From dbfe624f6701dda54e549ee1b0faef1fb651b41b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 9 Apr 2014 22:04:32 +0200 Subject: [PATCH] awful.tag.setscreen: Check if old_screen == new_screen Setting a tag's screen to what it already is shouldn't have any bad effects. However, this code messed up the tag order and selection status. Fix this by returning early if the tag already has the right screen. Signed-off-by: Uli Schlachter --- lib/awful/tag.lua.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in index ec5799128..ffc3e3d20 100644 --- a/lib/awful/tag.lua.in +++ b/lib/awful/tag.lua.in @@ -271,12 +271,12 @@ end -- @param s Screen number function tag.setscreen(t, s) local s = s or capi.mouse.screen + local old_screen = tag.getproperty(t, "screen") + if s == old_screen then return end -- Keeping the old index make very little sense when changing screen tag.setproperty(t, "index", nil) - local old_screen = tag.getproperty(t,"screen") - -- Change the screen tag.setproperty(t, "screen", s)