Make use of the new `oldscreen` argument with property::screen handlers

Closes #285
This commit is contained in:
Daniel Hahler 2015-03-17 17:11:40 +01:00
parent 34c059bf23
commit d361eeab34
2 changed files with 9 additions and 5 deletions

View File

@ -175,10 +175,10 @@ function taglist.new(screen, filter, buttons, style, update_function, base_widge
tag.attached_connect_signal(screen, "property::screen", ut)
tag.attached_connect_signal(screen, "property::index", ut)
tag.attached_connect_signal(screen, "property::urgent", ut)
capi.client.connect_signal("property::screen", function(c)
-- If client change screen, refresh it anyway since we don't from
-- which screen it was coming :-)
u(screen)
capi.client.connect_signal("property::screen", function(c, old_screen)
if screen == c.screen or screen == old_screen then
u(screen)
end
end)
capi.client.connect_signal("tagged", uc)
capi.client.connect_signal("untagged", uc)

View File

@ -160,7 +160,11 @@ function tasklist.new(screen, filter, buttons, style, update_function, base_widg
capi.client.connect_signal("property::icon_name", u)
capi.client.connect_signal("property::icon", u)
capi.client.connect_signal("property::skip_taskbar", u)
capi.client.connect_signal("property::screen", u)
capi.client.connect_signal("property::screen", function(c, old_screen)
if screen == c.screen or screen == old_screen then
u()
end
end)
capi.client.connect_signal("property::hidden", u)
capi.client.connect_signal("tagged", u)
capi.client.connect_signal("untagged", u)