diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-07 21:54:20 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-21 14:03:08 +0000 |
commit | 790a623dd347a1b517e1ff6d71e19df2323753fa (patch) | |
tree | f85a920b9e664d1bebdd8e5de8145d312f65aa2f | |
parent | a5f555cf6b1b30ef7a6464b5937fce2d24ee04ca (diff) |
Try to fix a race in configure_request handling which causes windows to be misplaced or misized
Would this be fixed by doing xsync() after xcb_configure_window()?
Server values for values not in value mask in configure_request can be out
of date if xcb_configure_window() we have made to pass on a configure_request
hasn't completed yet...
Ignoring configure requests for windows we are managing is wrong, it means
they can't request to move themselves?
-rw-r--r-- | src/libxcwm/event_loop.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libxcwm/event_loop.c b/src/libxcwm/event_loop.c index bf52806..45213b1 100644 --- a/src/libxcwm/event_loop.c +++ b/src/libxcwm/event_loop.c @@ -465,17 +465,19 @@ run_event_loop(void *thread_arg_struct) request->window, request->width, request->height, request->x, request->y, request->value_mask); - xcwm_window_t *window = - _xcwm_get_window_node_by_window_id(request->window); - if (!window) { - /* Passing on requests for windows we aren't - * managing seems to speed window future mapping - * of window */ - + /* + relying on the server's idea of the current values of values not + in value_mask is a bad idea, we might have a configure request of + our own on this window in flight + */ + if (request->value_mask & + (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT)) _xcwm_resize_window(event_conn, request->window, request->x, request->y, request->width, request->height); - } + + /* Ignore requests to change stacking ? */ + break; } |