condense appid/title logic

This commit is contained in:
Devin J. Pohly 2020-07-21 18:47:30 -04:00
parent a21c9378ee
commit a10357fae0

19
dwl.c
View file

@ -281,17 +281,14 @@ applyrules(Client *c)
/* rule matching */ /* rule matching */
c->isfloating = 0; c->isfloating = 0;
if (c->isxdg) { appid = c->isxdg ? c->xdg_surface->toplevel->app_id :
if (!(appid = c->xdg_surface->toplevel->app_id)) c->xwayland_surface->class;
appid = broken; title = c->isxdg ? c->xdg_surface->toplevel->title :
if (!(title = c->xdg_surface->toplevel->title)) c->xwayland_surface->title;
title = broken; if (!appid)
} else { appid = broken;
if (!(appid = c->xwayland_surface->class)) if (!title)
appid = broken; title = broken;
if (!(title = c->xwayland_surface->title))
title = broken;
}
for (r = rules; r < END(rules); r++) { for (r = rules; r < END(rules); r++) {
if ((!r->title || strstr(title, r->title)) if ((!r->title || strstr(title, r->title))