Commit 6637211e authored by Olivier Fourdan's avatar Olivier Fourdan 🛠 Committed by Olivier Fourdan

client: Really send synthetic configure notify

Commit 821ee7cc would not actually send the synthetic configure notify
events anymore. That obviously breaks plenty of applications…

While the logic of the commit itself is sound, the problem is that it
bases the descision to send the configure notify event by comparing
against the current window size and location.

The problem is that the current window size and location is modified in
various places, defeating the logic.

Add an “applied_geometry” rectangle that we update only in a single
place in the code, so that we know exactly when to send a synthetic
configure notify event.

Closes: #403Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <fourdan@xfce.org>
parent 6c712173
Pipeline #1330 passed with stages
in 2 minutes and 57 seconds
......@@ -840,13 +840,21 @@ clientConfigure (Client *c, XWindowChanges * wc, unsigned long mask, unsigned sh
http://www.mail-archive.com/wm-spec-list@gnome.org/msg00382.html
*/
win_moved = (c->x != px || c->y != py);
win_resized = (c->width != pwidth || c->height != pheight);
win_moved = (c->x != c->applied_geometry.x ||
c->y != c->applied_geometry.y);
win_resized = (c->width != c->applied_geometry.width ||
c->height != c->applied_geometry.height);
if ((win_moved) || (flags & CFG_NOTIFY) ||
((flags & CFG_REQUEST) && !(win_moved || win_resized)))
{
clientSendConfigureNotify (c);
}
c->applied_geometry.x = c->x;
c->applied_geometry.y = c->y;
c->applied_geometry.width = c->width;
c->applied_geometry.height = c->height;
}
void
......@@ -1676,6 +1684,11 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
c->width = attr.width;
c->height = attr.height;
c->applied_geometry.x = c->x;
c->applied_geometry.y = c->y;
c->applied_geometry.width = c->width;
c->applied_geometry.height = c->height;
#ifdef HAVE_LIBSTARTUP_NOTIFICATION
c->startup_id = NULL;
#endif /* HAVE_LIBSTARTUP_NOTIFICATION */
......
......@@ -313,6 +313,7 @@ struct _Client
gint border_width;
gint gravity;
guint win_workspace;
GdkRectangle applied_geometry;
GdkRectangle saved_geometry;
GdkRectangle pre_fullscreen_geometry;
gint pre_fullscreen_layer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment