inhibit idle if surface's node is enabled

This commit is contained in:
Leonardo Hernández Hernández 2022-11-13 16:46:43 -06:00
parent 93a911d6e9
commit 60a98b87f3
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

9
dwl.c
View File

@ -588,15 +588,12 @@ chvt(const Arg *arg)
void void
checkidleinhibitor(struct wlr_surface *exclude) checkidleinhibitor(struct wlr_surface *exclude)
{ {
Client *c;
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) {
/* In case we can't get a client from the surface assume that it is if (exclude != inhibitor->surface && (tree = inhibitor->surface->data)
* visible, for example a layer surface */ && tree->node.enabled) {
if (exclude != inhibitor->surface
&& (!(c = client_from_wlr_surface(inhibitor->surface))
|| VISIBLEON(c, c->mon))) {
inhibited = 1; inhibited = 1;
break; break;
} }