From eae9200c5dd5f5b63278e874c28d3ca9e891fd1f Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Thu, 16 Mar 2023 19:13:03 +0800 Subject: [PATCH] Fix ICCM ConfigureNotify request According to ICCM specs at [1] *Not changing the size, location, border width, or stacking order of the window at all. A client will receive a synthetic ConfigureNotify event that describes the (unchanged) geometry of the window. The (x,y) coordinates will be in the root coordinate system, adjusted for the border width the client requested, irrespective of any reparenting that has taken place. The border_width will be the border width the client requested. The client will not receive a real ConfigureNotify event because no change has actually taken place. *Moving or restacking the window without resizing it or changing its border width. A client will receive a synthetic ConfigureNotify event following the change that describes the new geometry of the window. The event's (x,y) coordinates will be in the root coordinate system adjusted for the border width the client requested. The border_width will be the border width the client requested. The client may not receive a real ConfigureNotify event that describes this change because the window manager may have reparented the top-level window. If the client does receive a real event, the synthetic event will follow the real one. *Resizing the window or changing its border width (regardless of whether the window was also moved or restacked). A client that has selected for StructureNotify events will receive a real ConfigureNotify event. Note that the coordinates in this event are relative to the parent, which may not be the root if the window has been reparented. The coordinates will reflect the actual border width of the window (which the window manager may have changed). The TranslateCoordinates request can be used to convert the coordinates if required. In Window Maker, the first case is not implemented: doing a synthetic ConfigureNotify to notify no changes were done. That's creating some issues with app like Citrix icaclient when sometime windows are blank and need to be moved to be refreshed. [1]https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#configuring_the_window --- src/window.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/window.c b/src/window.c index e707980f..2ce5f10f 100644 --- a/src/window.c +++ b/src/window.c @@ -2150,12 +2150,6 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re int resize; resize = (req_width != wwin->client.width || req_height != wwin->client.height); - /* - * if the window is being moved but not resized then - * send a synthetic ConfigureNotify - */ - if ((req_x != wwin->frame_x || req_y != wwin->frame_y) && !resize) - synth_notify = True; if (WFLAGP(wwin, dont_move_off)) wScreenBringInside(wwin->screen_ptr, &req_x, &req_y, req_width, req_height); @@ -2192,10 +2186,17 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re wwin->client.width = req_width; wwin->client.height = req_height; } else { - wwin->client.x = req_x; - wwin->client.y = req_y + wwin->frame->top_width; - - XMoveWindow(dpy, wwin->frame->core->window, req_x, req_y); + if (req_x != wwin->frame_x || req_y != wwin->frame_y) { + wwin->client.x = req_x; + wwin->client.y = req_y + wwin->frame->top_width; + XMoveWindow(dpy, wwin->frame->core->window, req_x, req_y); + } + /* + * if the window is being moved but not resized + * or if we change nothing then + * send a synthetic ConfigureNotify + */ + synth_notify = True; } wwin->frame_x = req_x; wwin->frame_y = req_y; -- 2.11.4.GIT