diff options
author | Samuel Fadel <samuel@nihil.ws> | 2022-12-05 18:05:26 +0100 |
---|---|---|
committer | Samuel Fadel <samuel@nihil.ws> | 2022-12-05 18:05:26 +0100 |
commit | be35a3e1a5f4e7c4212f6132f088fbfc8cf3e381 (patch) | |
tree | 690e29d830a452b1d3e4d8da3033fe093eba6576 /schewm.c | |
parent | efb43186091571859a343f533b5cb6a5ab58683b (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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 }; |