Skip to content

Commit 597f1ee

Browse files
committed
Do not update shapes on property::size
The internal::update_shapes signal will be emitted by client_refresh which does it. Also, delay it until next frame. For some reason updating shapes directly within client_refresh introduces some flicker
1 parent f1388f9 commit 597f1ee

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/awful/client/shape.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
-- Grab environment we need
1010
local surface = require("gears.surface")
1111
local cairo = require("lgi").cairo
12+
local timer = require("gears.timer")
1213
local capi =
1314
{
1415
client = client,
@@ -98,6 +99,15 @@ function shape.update.all(c)
9899
shape.update.input(c)
99100
end
100101

102+
--- Schedules shape.update.all to be called next frame.
103+
-- @function awful.client.shape.update.all
104+
-- @tparam client c The client to act on
105+
function shape.update.all_delayed(c)
106+
timer.delayed_call(function()
107+
shape.update.all(c)
108+
end)
109+
end
110+
101111
--- Update a client's bounding shape from the shape the client set itself.
102112
-- @function awful.client.shape.update.bounding
103113
-- @tparam client c The client to act on
@@ -136,9 +146,8 @@ end
136146
capi.client.connect_signal("property::shape_client_bounding", shape.update.bounding)
137147
capi.client.connect_signal("property::shape_client_clip", shape.update.clip)
138148
capi.client.connect_signal("property::shape_client_input", shape.update.input)
139-
capi.client.connect_signal("property::size", shape.update.all)
140149
capi.client.connect_signal("property::border_width", shape.update.all)
141-
capi.client.connect_signal("internal::update_shapes", shape.update.all)
150+
capi.client.connect_signal("internal::update_shapes", shape.update.all_delayed)
142151

143152
return shape
144153

0 commit comments

Comments
 (0)