diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-07 21:43:39 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-21 14:03:01 +0000 |
commit | b3d30df1fd2684766bd8a0ba3a50b3329ad6521c (patch) | |
tree | 9c4d66fb57746d70b5a31a7259012c23f189d6da | |
parent | 887402e2fa259411b94bec91b941d7c29caff5ad (diff) |
Ignore InputOnly windows
Don't create a xcwm_window_t for an InputOnly window
Handle _xcwm_window_create returning NULL in MAP_NOTIFY
-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 |