[Xfce4-commits] [xfce/xfwm4] 02/04: client: Check when GTK_FRAME_EXTENTS has changed
noreply at xfce.org
noreply at xfce.org
Thu Jul 26 07:17:53 CEST 2018
This is an automated email from the git hooks/post-receive script.
o l i v i e r p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfwm4.
commit 0a5ba680f27a48242d52c590727deb837708da09
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Sun Jul 22 10:54:35 2018 +0200
client: Check when GTK_FRAME_EXTENTS has changed
Bug: 14511
GTK+ will update its GTK_FRAME_EXTENTS property continuously even when
the value hasn't actually changed, which causes the maximized state to
be cleared when transitioning to/from fullscreen to maximized.
Check that he extents have changed and reconfigure the client's window
only when the value has changed.
---
src/client.c | 9 +++++++--
src/events.c | 6 ++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/client.c b/src/client.c
index 2bf66bf..3059fb6 100644
--- a/src/client.c
+++ b/src/client.c
@@ -4021,6 +4021,7 @@ clientGetGtkFrameExtents (Client * c)
{
ScreenInfo *screen_info;
DisplayInfo *display_info;
+ gboolean value_changed = FALSE;
gulong *extents;
int nitems;
int i;
@@ -4040,7 +4041,11 @@ clientGetGtkFrameExtents (Client * c)
FLAG_SET (c->flags, CLIENT_FLAG_HAS_FRAME_EXTENTS);
for (i = 0; i < SIDE_COUNT; i++)
{
- c->frame_extents[i] = (int) extents[i];
+ if (c->frame_extents[i] != (int) extents[i])
+ {
+ value_changed = TRUE;
+ c->frame_extents[i] = (int) extents[i];
+ }
}
}
}
@@ -4050,7 +4055,7 @@ clientGetGtkFrameExtents (Client * c)
XFree (extents);
}
- return FLAG_TEST (c->flags, CLIENT_FLAG_HAS_FRAME_EXTENTS);
+ return value_changed;
}
gboolean
diff --git a/src/events.c b/src/events.c
index 688943c..9bd9219 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1838,8 +1838,10 @@ handlePropertyNotify (DisplayInfo *display_info, XPropertyEvent * ev)
else if (ev->atom == display_info->atoms[GTK_FRAME_EXTENTS])
{
TRACE ("client \"%s\" (0x%lx) has received a GTK_FRAME_EXTENTS notify", c->name, c->window);
- clientGetGtkFrameExtents (c);
- clientUpdateMaximizeSize (c);
+ if (clientGetGtkFrameExtents (c))
+ {
+ clientUpdateMaximizeSize (c);
+ }
}
else if (ev->atom == display_info->atoms[GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED])
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list