simplify `if` expression in checkidleinhibitor()

このコミットが含まれているのは:
Leonardo Hernández Hernández 2022-11-13 16:39:17 -06:00
コミット 93a911d6e9
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: E538897EE11B9624
1個のファイルの変更4行の追加5行の削除

9
dwl.c
ファイルの表示

@ -588,16 +588,15 @@ 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_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) {
Client *c;
if (exclude == inhibitor->surface)
continue;
/* In case we can't get a client from the surface assume that it is /* In case we can't get a client from the surface assume that it is
* visible, for example a layer surface */ * visible, for example a layer surface */
if (!(c = client_from_wlr_surface(inhibitor->surface)) if (exclude != inhibitor->surface
|| VISIBLEON(c, c->mon)) { && (!(c = client_from_wlr_surface(inhibitor->surface))
|| VISIBLEON(c, c->mon))) {
inhibited = 1; inhibited = 1;
break; break;
} }