diff options
-rw-r--r-- | src/libxcwm/event_loop.c | 21 | ||||
-rw-r--r-- | src/libxcwm/window.c | 7 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/libxcwm/event_loop.c b/src/libxcwm/event_loop.c index 0670244..758fd46 100644 --- a/src/libxcwm/event_loop.c +++ b/src/libxcwm/event_loop.c @@ -369,14 +369,25 @@ run_event_loop(void *thread_arg_struct) _xcwm_window_create(context, notify->window, notify->event); + if (window) + { + if (!return_evt->window) { + free(return_evt); + break; + } + + _xcwm_window_composite_pixmap_update(window); + + return_evt->window = window; + return_evt->event_type = XCWM_EVENT_WINDOW_CREATE; + callback_ptr(return_evt); + } + } + else + { _xcwm_window_composite_pixmap_update(window); - - return_evt->window = window; - return_evt->event_type = XCWM_EVENT_WINDOW_CREATE; - callback_ptr(return_evt); } - _xcwm_window_composite_pixmap_update(window); break; } diff --git a/src/libxcwm/window.c b/src/libxcwm/window.c index b1de187..68c725a 100644 --- a/src/libxcwm/window.c +++ b/src/libxcwm/window.c @@ -94,6 +94,11 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window, return NULL; } + /* Ignore InputOnly windows */ + xcb_get_window_attributes_reply_t *attrs = + _xcwm_get_window_attributes(context->conn, new_window); + if ((!attrs) || (attrs->_class == XCB_WINDOW_CLASS_INPUT_ONLY)) + return NULL; /* allocate memory for new xcwm_window_t and rectangles */ xcwm_window_t *window = malloc(sizeof(xcwm_window_t)); assert(window); @@ -125,8 +130,6 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window, free(geom); /* Get value of override_redirect flag */ - xcb_get_window_attributes_reply_t *attrs = - _xcwm_get_window_attributes(context->conn, new_window); window->override_redirect = attrs->override_redirect; /* FIXME: Workaround for initial damage reporting for * override-redirect windows. Initial damage event is relative to |