From 970d2e7bd9b837381fb17ad80f4a8168d4736afa Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Sat, 22 Mar 2008 18:48:58 +0000 Subject: [PATCH] When handling a ConfigureRequest, send a ConfigureWindow according to the event value mask. --- event.c | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/event.c b/event.c index b36d763f..ab22d445 100644 --- a/event.c +++ b/event.c @@ -216,15 +216,47 @@ event_handle_configurerequest(void *data __attribute__ ((unused)), } else { - const uint32_t configure_values[] = { - ev->x, ev->y, ev->width, ev->height, ev->border_width, - ev->sibling, ev->stack_mode }; + uint16_t config_win_mask = 0; + uint32_t config_win_vals[7]; + unsigned short i = 0; - xcb_configure_window(connection, ev->window, - XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | - XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_BORDER_WIDTH | - XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, - configure_values); + if(ev->value_mask & XCB_CONFIG_WINDOW_X) + { + config_win_mask |= XCB_CONFIG_WINDOW_X; + config_win_vals[i++] = ev->x; + } + if(ev->value_mask & XCB_CONFIG_WINDOW_Y) + { + config_win_mask |= XCB_CONFIG_WINDOW_Y; + config_win_vals[i++] = ev->y; + } + if(ev->value_mask & XCB_CONFIG_WINDOW_WIDTH) + { + config_win_mask |= XCB_CONFIG_WINDOW_WIDTH; + config_win_vals[i++] = ev->width; + } + if(ev->value_mask & XCB_CONFIG_WINDOW_HEIGHT) + { + config_win_mask |= XCB_CONFIG_WINDOW_HEIGHT; + config_win_vals[i++] = ev->height; + } + if(ev->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) + { + config_win_mask |= XCB_CONFIG_WINDOW_BORDER_WIDTH; + config_win_vals[i++] = ev->border_width; + } + if(ev->value_mask & XCB_CONFIG_WINDOW_SIBLING) + { + config_win_mask |= XCB_CONFIG_WINDOW_SIBLING; + config_win_vals[i++] = ev->sibling; + } + if(ev->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) + { + config_win_mask |= XCB_CONFIG_WINDOW_STACK_MODE; + config_win_vals[i++] = ev->stack_mode; + } + + xcb_configure_window(connection, ev->window, config_win_mask, config_win_vals); } return 0;