From 1f36a3d4de62e51c1b8b84dd4e5ce1ab2e1daa72 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 1 Aug 2010 14:24:58 +0200 Subject: [PATCH] Obey ICCCM 4.1.5 / 4.2.3 When a window is moved, it should be sent a synthetic ConfigureNotify describing its new position. This also documents why we send a synthetic event if nothing was changed in response to a ConfigureRequest. Signed-off-by: Uli Schlachter --- event.c | 1 + objects/client.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/event.c b/event.c index fe605e2ab..a1b48f5bd 100644 --- a/event.c +++ b/event.c @@ -275,6 +275,7 @@ event_handle_configurerequest(xcb_configure_request_event_t *ev) } if(!client_resize(c, geometry, false)) + /* ICCCM 4.1.5 / 4.2.3, if nothing was changed, send an event saying so */ xwindow_configure(c->window, geometry, c->border_width); } else diff --git a/objects/client.c b/objects/client.c index e7d601113..1e0972b53 100644 --- a/objects/client.c +++ b/objects/client.c @@ -732,9 +732,14 @@ client_resize(client_t *c, area_t geometry, bool hints) || c->geometry.width != geometry.width || c->geometry.height != geometry.height) { + bool send_notice = false; screen_t *new_screen = screen_getbycoord(c->screen, geometry.x, geometry.y); + if(c->geometry.width == geometry.width + && c->geometry.height == geometry.height) + send_notice = true; + /* Also store geometry including border */ c->geometry = geometry; @@ -748,6 +753,10 @@ client_resize(client_t *c, area_t geometry, bool hints) XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, (uint32_t[]) { geometry.x, geometry.y, geometry.width, geometry.height }); + if(send_notice) + /* We are moving without changing the size, see ICCCM 4.2.3 */ + xwindow_configure(c->window, geometry, c->border_width); + client_restore_enterleave_events(); screen_client_moveto(c, new_screen, false);