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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2014-04-09 22:04:32 +02:00
parent ca92846bb2
commit dbfe624f67
1 changed files with 2 additions and 2 deletions

View File

@ -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)