When handling a ConfigureRequest, send a ConfigureWindow according to

the event value mask.
This commit is contained in:
Arnaud Fontaine 2008-03-22 18:48:58 +00:00 committed by Julien Danjou
parent 4a1720ddca
commit 970d2e7bd9
1 changed files with 40 additions and 8 deletions

48
event.c
View File

@ -216,15 +216,47 @@ event_handle_configurerequest(void *data __attribute__ ((unused)),
} }
else else
{ {
const uint32_t configure_values[] = { uint16_t config_win_mask = 0;
ev->x, ev->y, ev->width, ev->height, ev->border_width, uint32_t config_win_vals[7];
ev->sibling, ev->stack_mode }; unsigned short i = 0;
xcb_configure_window(connection, ev->window, if(ev->value_mask & XCB_CONFIG_WINDOW_X)
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | {
XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_BORDER_WIDTH | config_win_mask |= XCB_CONFIG_WINDOW_X;
XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, config_win_vals[i++] = ev->x;
configure_values); }
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; return 0;