mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
tag: Fix index when screen count change.
There was still a problem that caused the "old" tags to be inserted in the wrong position when "saved" from a screen being removed. Also, this use a :get_tags(true) to save an uneeded sorting pass.
This commit is contained in:
parent
1be737be3a
commit
d2988d1aab
1 changed files with 3 additions and 4 deletions
|
@ -465,6 +465,7 @@ function tag.object.set_screen(t, s)
|
|||
|
||||
-- Change the screen
|
||||
tag.setproperty(t, "screen", s)
|
||||
tag.setproperty(t, "index", #s:get_tags(true))
|
||||
|
||||
-- Make sure the client's screen matches its tags
|
||||
for _,c in ipairs(t:clients()) do
|
||||
|
@ -473,10 +474,8 @@ function tag.object.set_screen(t, s)
|
|||
end
|
||||
|
||||
-- Update all indexes
|
||||
for _,screen in ipairs {old_screen, s} do
|
||||
for i,t2 in ipairs(screen.tags) do
|
||||
tag.setproperty(t2, "index", i)
|
||||
end
|
||||
for i,t2 in ipairs(old_screen.tags) do
|
||||
tag.setproperty(t2, "index", i)
|
||||
end
|
||||
|
||||
-- Restore the old screen history if the tag was selected
|
||||
|
|
Loading…
Reference in a new issue