[Xfce4-commits] [xfce/xfwm4] 07/08: client: Check when GTK_FRAME_EXTENTS has changed

noreply at xfce.org noreply at xfce.org
Fri Jul 27 22:35:12 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       x   f   c   e   -   4   .   1   2   
   in repository xfce/xfwm4.

commit 18575f3a098c7bbb3a43838c7745e01efa260997
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.
    
    (cherry picked from commit 0a5ba680f27a48242d52c590727deb837708da09)
---
 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 3a5531d..df34eb0 100644
--- a/src/client.c
+++ b/src/client.c
@@ -4047,6 +4047,7 @@ clientGetGtkFrameExtents (Client * c)
 {
     ScreenInfo *screen_info;
     DisplayInfo *display_info;
+    gboolean value_changed = FALSE;
     gulong *extents;
     int nitems;
     int i;
@@ -4066,7 +4067,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];
+                }
             }
         }
     }
@@ -4076,7 +4081,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 50303b0..74503e3 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1831,8 +1831,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