aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-11-13 16:39:17 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-11-21 14:28:04 -0600
commit93a911d6e93f760a5139bfe0d1c1eb90886c414f (patch)
tree33d639519356b6eccd12f8001251144a3017bf1a
parent88d386bfdcedb8b46d7c4c7a3ebac2476cfcf46b (diff)
simplify `if` expression in checkidleinhibitor()
-rw-r--r--dwl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/dwl.c b/dwl.c
index 2903d9d..8599764 100644
--- a/dwl.c
+++ b/dwl.c
@@ -588,16 +588,15 @@ chvt(const Arg *arg)
void
checkidleinhibitor(struct wlr_surface *exclude)
{
+ Client *c;
int inhibited = 0;
struct wlr_idle_inhibitor_v1 *inhibitor;
wl_list_for_each(inhibitor, &idle_inhibit_mgr->inhibitors, link) {
- Client *c;
- if (exclude == inhibitor->surface)
- continue;
/* In case we can't get a client from the surface assume that it is
* visible, for example a layer surface */
- if (!(c = client_from_wlr_surface(inhibitor->surface))
- || VISIBLEON(c, c->mon)) {
+ if (exclude != inhibitor->surface
+ && (!(c = client_from_wlr_surface(inhibitor->surface))
+ || VISIBLEON(c, c->mon))) {
inhibited = 1;
break;
}