diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2020-07-21 18:47:30 -0400 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2020-07-21 18:47:30 -0400 |
commit | a10357fae06dded1818d4b12105680f9a08803fb (patch) | |
tree | e164d0e0fadd1292c6986f8d7b52b5c2731e1c99 | |
parent | a21c9378ee7c9b1c4165a2df742a639b7393a322 (diff) |
condense appid/title logic
-rw-r--r-- | dwl.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -281,17 +281,14 @@ applyrules(Client *c) /* rule matching */ c->isfloating = 0; - if (c->isxdg) { - if (!(appid = c->xdg_surface->toplevel->app_id)) - appid = broken; - if (!(title = c->xdg_surface->toplevel->title)) - title = broken; - } else { - if (!(appid = c->xwayland_surface->class)) - appid = broken; - if (!(title = c->xwayland_surface->title)) - title = broken; - } + appid = c->isxdg ? c->xdg_surface->toplevel->app_id : + c->xwayland_surface->class; + title = c->isxdg ? c->xdg_surface->toplevel->title : + c->xwayland_surface->title; + if (!appid) + appid = broken; + if (!title) + title = broken; for (r = rules; r < END(rules); r++) { if ((!r->title || strstr(title, r->title)) |