forked from mirror/dwl
use root surfaces to check idle inhibitors
References: https://github.com/djpohly/dwl/pull/343
This commit is contained in:
parent
035bb99d67
commit
fac3b6f2cf
1 changed files with 4 additions and 3 deletions
7
dwl.c
7
dwl.c
|
@ -596,8 +596,9 @@ checkidleinhibitor(struct wlr_surface *exclude)
|
||||||
int inhibited = 0;
|
int inhibited = 0;
|
||||||
struct wlr_idle_inhibitor_v1 *inhibitor;
|
struct wlr_idle_inhibitor_v1 *inhibitor;
|
||||||
wl_list_for_each(inhibitor, &idle_inhibit_mgr->inhibitors, link) {
|
wl_list_for_each(inhibitor, &idle_inhibit_mgr->inhibitors, link) {
|
||||||
struct wlr_scene_tree *tree = inhibitor->surface->data;
|
struct wlr_surface *surface = wlr_surface_get_root_surface(inhibitor->surface);
|
||||||
if (bypass_surface_visibility || (exclude != inhibitor->surface
|
struct wlr_scene_tree *tree = surface->data;
|
||||||
|
if (bypass_surface_visibility || (exclude != surface
|
||||||
&& tree->node.enabled)) {
|
&& tree->node.enabled)) {
|
||||||
inhibited = 1;
|
inhibited = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -1014,7 +1015,7 @@ destroyidleinhibitor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
/* `data` is the wlr_surface of the idle inhibitor being destroyed,
|
/* `data` is the wlr_surface of the idle inhibitor being destroyed,
|
||||||
* 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(data);
|
checkidleinhibitor(wlr_surface_get_root_surface(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue