mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
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.
This commit is contained in:
parent
9c3590f6a0
commit
54fa734c2d
2 changed files with 5 additions and 4 deletions
|
|
@ -22,6 +22,7 @@ struct sway_idle_inhibit_manager_v1 {
|
|||
|
||||
struct sway_idle_inhibitor_v1 {
|
||||
struct sway_idle_inhibit_manager_v1 *manager;
|
||||
struct wlr_idle_inhibitor_v1 *wlr_inhibitor;
|
||||
struct sway_view *view;
|
||||
enum sway_idle_inhibit_mode mode;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue