summaryrefslogtreecommitdiff
path: root/schewm.c
diff options
context:
space:
mode:
Diffstat (limited to 'schewm.c')
-rw-r--r--schewm.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/schewm.c b/schewm.c
index 8a03fd7..87cfbab 100644
--- a/schewm.c
+++ b/schewm.c
@@ -1351,8 +1351,8 @@ dpy_fetch_cursor_position(struct Point *p) {
return true;
}
-struct Client *
-dpy_make_client(xcb_window_t window) {
+static bool
+dpy_should_ignore_window(xcb_window_t window) {
xcb_ewmh_get_atoms_reply_t window_type;
xcb_get_property_cookie_t cookie =
xcb_ewmh_get_wm_window_type(dpy.ewmh, window);
@@ -1361,9 +1361,9 @@ dpy_make_client(xcb_window_t window) {
cookie,
&window_type,
NULL);
+ bool should_ignore = false;
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
@@ -1375,9 +1375,14 @@ dpy_make_client(xcb_window_t window) {
}
}
xcb_ewmh_get_atoms_reply_wipe(&window_type);
- if (should_ignore) {
- return NULL;
- }
+ }
+ return should_ignore;
+}
+
+struct Client *
+dpy_make_client(xcb_window_t window) {
+ if (dpy_should_ignore_window(window)) {
+ return NULL;
}
uint32_t event_mask[] = { XCB_EVENT_MASK_ENTER_WINDOW, XCB_NONE };