From f0ab2aebebfaa391de3efdc9598e5fb23a52e483 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 5 Dec 2014 18:40:06 +0100 Subject: [PATCH] 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 --- event.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/event.c b/event.c index 50511e0b..57a7fa1f 100644 --- a/event.c +++ b/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; if(ev->value_mask & XCB_CONFIG_WINDOW_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) + { 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) { uint16_t old_w = geometry.width;