simplify check for surface's node state

all `struct wlr_surface` should have a `wlr_scene_tree *` as data
This commit is contained in:
Leonardo Hernández Hernández 2022-11-30 18:54:54 -06:00
parent 10c56d6348
commit 6df6781b43
No known key found for this signature in database
GPG key ID: E538897EE11B9624

3
dwl.c
View file

@ -594,11 +594,10 @@ void
checkidleinhibitor(struct wlr_surface *exclude) checkidleinhibitor(struct wlr_surface *exclude)
{ {
int inhibited = 0; int inhibited = 0;
struct wlr_scene_tree *tree;
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;
if (bypass_surface_visibility || (exclude != inhibitor->surface if (bypass_surface_visibility || (exclude != inhibitor->surface
&& (tree = inhibitor->surface->data)
&& tree->node.enabled)) { && tree->node.enabled)) {
inhibited = 1; inhibited = 1;
break; break;