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 <psychon@znc.in>
This commit is contained in:
parent
a5afa009dc
commit
1f36a3d4de
1
event.c
1
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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue