From ec8db18289073be8e327262b4615f379cf2b3221 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 (FS#1249) 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 79bfba6d..58b0a344 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)