From be35a3e1a5f4e7c4212f6132f088fbfc8cf3e381 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Mon, 5 Dec 2022 18:05:26 +0100 Subject: Minor logic improvement when initializing clients. * schewm.c: dpy_make_client: Improve logic to avoid cleanup in two places. --- schewm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'schewm.c') 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 }; -- cgit v1.2.3