[Xfce4-commits] <xfwm4:libxfce4ui> Keep windows entirely visible on screen change (bug #5795)

Olivier Fourdan noreply at xfce.org
Sun Jan 10 10:24:26 CET 2010


Updating branch refs/heads/libxfce4ui
         to c840d41acb25349d031dc60b219976a7df97b395 (commit)
       from 9056db4dab02d8fc3d0d70581126eb1549ac8ab2 (commit)

commit c840d41acb25349d031dc60b219976a7df97b395
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Sat Oct 10 20:05:36 2009 +0200

    Keep windows entirely visible on screen change (bug #5795)

 src/client.c |   17 ++++++++++-------
 src/client.h |    3 ++-
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/client.c b/src/client.c
index 19354cd..3addde6 100644
--- a/src/client.c
+++ b/src/client.c
@@ -722,8 +722,7 @@ clientConfigure (Client * c, XWindowChanges * wc, unsigned long mask, unsigned s
          && CONSTRAINED_WINDOW (c)
          && !((c->gravity == StaticGravity) && (c->x == 0) && (c->y == 0)))
     {
-        /* Keep fully visible only on resize */
-        clientConstrainPos (c, (mask & (CWWidth | CWHeight)));
+        clientConstrainPos (c, CFG_KEEP_VISIBLE);
 
         if (c->x != px)
         {
@@ -804,7 +803,7 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask)
 {
     ScreenInfo *screen_info;
     DisplayInfo *display_info;
-    gboolean constrained;
+    unsigned short flags;
 
     g_return_if_fail (c != NULL);
     TRACE ("entering clientMoveResizeWindow");
@@ -843,14 +842,18 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask)
     }
 
     /* Still a move/resize after cleanup? */
-    constrained = FALSE;
+    flags = CFG_REQUEST;
     if (mask & (CWX | CWY | CWWidth | CWHeight))
     {
         if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED))
         {
             clientRemoveMaximizeFlag (c);
         }
-        constrained = TRUE;
+        flags |= CFG_REQUEST;
+    }
+    if (mask & (CWWidth | CWHeight))
+    {
+        flags |= CFG_KEEP_VISIBLE;
     }
     /*
        Let's say that if the client performs a XRaiseWindow, we show the window if focus
@@ -878,7 +881,7 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask)
         }
     }
     /* And finally, configure the window */
-    clientConfigure (c, wc, mask, (constrained ? CFG_CONSTRAINED : 0) | CFG_REQUEST);
+    clientConfigure (c, wc, mask, flags);
 }
 
 void
@@ -3505,7 +3508,7 @@ clientScreenResize(ScreenInfo *screen_info)
         {
              wc.x = c->x;
              wc.y = c->y;
-             clientConfigure (c, &wc, CWX | CWY, CFG_CONSTRAINED | CFG_REQUEST);
+             clientConfigure (c, &wc, CWX | CWY, CFG_CONSTRAINED | CFG_REQUEST | CFG_KEEP_VISIBLE);
         }
     }
 
diff --git a/src/client.h b/src/client.h
index b16c0d0..fdb59fa 100644
--- a/src/client.h
+++ b/src/client.h
@@ -64,7 +64,8 @@
 #define CFG_CONSTRAINED                 (1<<0)
 #define CFG_REQUEST                     (1<<1)
 #define CFG_NOTIFY                      (1<<2)
-#define CFG_FORCE_REDRAW                (1<<3)
+#define CFG_KEEP_VISIBLE                (1<<3)
+#define CFG_FORCE_REDRAW                (1<<4)
 
 #define SEARCH_INCLUDE_HIDDEN           (1<<0)
 #define SEARCH_INCLUDE_SHADED           (1<<1)



More information about the Xfce4-commits mailing list