summaryrefslogtreecommitdiff
path: root/schewm.c
diff options
context:
space:
mode:
authorSamuel Fadel <samuel@nihil.ws>2022-12-05 18:05:26 +0100
committerSamuel Fadel <samuel@nihil.ws>2022-12-05 18:05:26 +0100
commitbe35a3e1a5f4e7c4212f6132f088fbfc8cf3e381 (patch)
tree690e29d830a452b1d3e4d8da3033fe093eba6576 /schewm.c
parentefb43186091571859a343f533b5cb6a5ab58683b (diff)
Minor logic improvement when initializing clients.
* schewm.c: dpy_make_client: Improve logic to avoid cleanup in two places.
Diffstat (limited to 'schewm.c')
-rw-r--r--schewm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/schewm.c b/schewm.c
index dd90982..8a03fd7 100644
--- a/schewm.c
+++ b/schewm.c
@@ -1362,17 +1362,22 @@ dpy_make_client(xcb_window_t window) {
&window_type,
NULL);
if (reply) {
+ // Figure out from window type if we should ignore it
+ bool should_ignore = false;
for (uint32_t i = 0; i < window_type.atoms_len; i++) {
xcb_atom_t atom = window_type.atoms[i];
if (atom == dpy.ewmh->_NET_WM_WINDOW_TYPE_TOOLBAR
|| atom == dpy.ewmh->_NET_WM_WINDOW_TYPE_DESKTOP
|| atom == dpy.ewmh->_NET_WM_WINDOW_TYPE_DOCK) {
// Ignore those windows
- xcb_ewmh_get_atoms_reply_wipe(&window_type);
- return NULL;
+ should_ignore = true;
+ break;
}
}
xcb_ewmh_get_atoms_reply_wipe(&window_type);
+ if (should_ignore) {
+ return NULL;
+ }
}
uint32_t event_mask[] = { XCB_EVENT_MASK_ENTER_WINDOW, XCB_NONE };