awful.layout: move arrange locks
This fixes a deadlock when some arrange signal handler itself changes a property like `border_width`: function border1(c) c.border_width = 50 end client.connect_signal("property::border_width", border1) awful.screen.connect_for_each_screen(function(s) local border_for_s = function(s_) local clients = awful.client.visible(s_) for _, c in pairs(clients) do c.border_width = 2 end end screen[s]:connect_signal("arrange", border_for_s) end) It might be better to have some counter there instead and emit a warning if this happens (while allowing for e.g. 3 recursions). This would allow handlers to break out of this themselves (by not insisting to change the property).
This commit is contained in:
parent
7d0976912e
commit
57e05cda1c
|
@ -232,10 +232,11 @@ function layout.arrange(screen)
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
screen:emit_signal("arrange")
|
||||||
|
|
||||||
|
-- Release locks after signal to avoid deadly lock.
|
||||||
arrange_lock = false
|
arrange_lock = false
|
||||||
delayed_arrange[screen] = nil
|
delayed_arrange[screen] = nil
|
||||||
|
|
||||||
screen:emit_signal("arrange")
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue