mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-29 05:40:19 -04:00
create idle inhibitor links dynamically
This commit is contained in:
parent
d1c2f43498
commit
292a51e49e
1 changed files with 4 additions and 1 deletions
5
dwl.c
5
dwl.c
|
|
@ -925,7 +925,9 @@ void
|
||||||
createidleinhibitor(struct wl_listener *listener, void *data)
|
createidleinhibitor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_idle_inhibitor_v1 *idle_inhibitor = data;
|
struct wlr_idle_inhibitor_v1 *idle_inhibitor = data;
|
||||||
LISTEN_STATIC(&idle_inhibitor->events.destroy, destroyidleinhibitor);
|
struct wl_listener *destroy_listener = ecalloc(1, sizeof(*destroy_listener));
|
||||||
|
|
||||||
|
LISTEN(&idle_inhibitor->events.destroy, destroy_listener, destroyidleinhibitor);
|
||||||
|
|
||||||
checkidleinhibitor(NULL);
|
checkidleinhibitor(NULL);
|
||||||
}
|
}
|
||||||
|
|
@ -1255,6 +1257,7 @@ destroyidleinhibitor(struct wl_listener *listener, void *data)
|
||||||
* at this point the idle inhibitor is still in the list of the manager */
|
* at this point the idle inhibitor is still in the list of the manager */
|
||||||
checkidleinhibitor(wlr_surface_get_root_surface(data));
|
checkidleinhibitor(wlr_surface_get_root_surface(data));
|
||||||
wl_list_remove(&listener->link);
|
wl_list_remove(&listener->link);
|
||||||
|
free(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue