aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2021-03-20 12:30:53 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2021-03-21 12:27:29 +0100
commit152a559e30244e64d4d61b9c87db442dfa04ee52 (patch)
tree85acf3cb2d17c1e4eaa312813053de5b6e3bcd14 /include
parentview: Handle NULL role object when role is set (diff)
downloadsway-152a559e30244e64d4d61b9c87db442dfa04ee52.tar.gz
sway-152a559e30244e64d4d61b9c87db442dfa04ee52.tar.zst
sway-152a559e30244e64d4d61b9c87db442dfa04ee52.zip
idle_inhibit: Store wlr inhibitor instead of view
When an application inhibited idle, a view pointer was stored and a destroy listener was registered to the wlr inhibitor. As the wlr inhibitor lives longer than the view, this lead to a dangling view pointer between view unmap and inhibitor destroy. Store a pointer to the wlr inhibitor instead of to the view, and look up the view when needed, which may at any point be NULL. This also allows for an inhibitor to remain functional if a surface is re-mapped.
Diffstat (limited to 'include')
-rw-r--r--include/sway/desktop/idle_inhibit_v1.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sway/desktop/idle_inhibit_v1.h b/include/sway/desktop/idle_inhibit_v1.h
index 0adafdb9..58d54c68 100644
--- a/include/sway/desktop/idle_inhibit_v1.h
+++ b/include/sway/desktop/idle_inhibit_v1.h
@@ -22,6 +22,7 @@ struct sway_idle_inhibit_manager_v1 {
22 22
23struct sway_idle_inhibitor_v1 { 23struct sway_idle_inhibitor_v1 {
24 struct sway_idle_inhibit_manager_v1 *manager; 24 struct sway_idle_inhibit_manager_v1 *manager;
25 struct wlr_idle_inhibitor_v1 *wlr_inhibitor;
25 struct sway_view *view; 26 struct sway_view *view;
26 enum sway_idle_inhibit_mode mode; 27 enum sway_idle_inhibit_mode mode;
27 28