Don't move clients on ConfigureRequests (FS#1030)
I never saw a single program that set a border on its own windows. However, awesome commonly sets borders on its clients and the position of a client is the part outside of the border. So when processing a position request from a client, we also have to include this border and fix things up correspondingly. However, the same isn't needed for the client size, because the size does not include the borders, but just the titlebar plus the "real" client content. Thanks to Daniel Hahler for providing a simple test case based on urxvt for debugging this! Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
1f431384cb
commit
f4a7b2d73a
8
event.c
8
event.c
|
@ -299,9 +299,17 @@ event_handle_configurerequest(xcb_configure_request_event_t *ev)
|
||||||
int16_t diff_w = 0, diff_h = 0, diff_border = 0;
|
int16_t diff_w = 0, diff_h = 0, diff_border = 0;
|
||||||
|
|
||||||
if(ev->value_mask & XCB_CONFIG_WINDOW_X)
|
if(ev->value_mask & XCB_CONFIG_WINDOW_X)
|
||||||
|
{
|
||||||
geometry.x = ev->x;
|
geometry.x = ev->x;
|
||||||
|
/* The ConfigureRequest specifies the position of the outer corner of the client window, we want the frame */
|
||||||
|
geometry.x -= c->border_width;
|
||||||
|
}
|
||||||
if(ev->value_mask & XCB_CONFIG_WINDOW_Y)
|
if(ev->value_mask & XCB_CONFIG_WINDOW_Y)
|
||||||
|
{
|
||||||
geometry.y = ev->y;
|
geometry.y = ev->y;
|
||||||
|
/* The ConfigureRequest specifies the position of the outer corner of the client window, we want the frame */
|
||||||
|
geometry.y -= c->border_width;
|
||||||
|
}
|
||||||
if(ev->value_mask & XCB_CONFIG_WINDOW_WIDTH)
|
if(ev->value_mask & XCB_CONFIG_WINDOW_WIDTH)
|
||||||
{
|
{
|
||||||
uint16_t old_w = geometry.width;
|
uint16_t old_w = geometry.width;
|
||||||
|
|
Loading…
Reference in New Issue