[Xfce4-commits] [xfce/xfwm4] 03/04: Use cairo wireframe for move/resize

noreply at xfce.org noreply at xfce.org
Mon Jan 19 22:54:32 CET 2015


This is an automated email from the git hooks/post-receive script.

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit 7a31a8884ed9f1277cdfb4898747c585d6169292
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Mon Jan 19 22:41:53 2015 +0100

    Use cairo wireframe for move/resize
    
    Only if the compositor is enabled and opaque move/resize us unset.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/moveresize.c |   81 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 71 insertions(+), 10 deletions(-)

diff --git a/src/moveresize.c b/src/moveresize.c
index 6493207..2fdfd14 100644
--- a/src/moveresize.c
+++ b/src/moveresize.c
@@ -46,6 +46,7 @@
 #include "settings.h"
 #include "transients.h"
 #include "event_filter.h"
+#include "wireframe.h"
 #include "workspaces.h"
 #include "xsync.h"
 
@@ -56,11 +57,14 @@
     LeaveWindowMask
 
 #define TILE_DISTANCE 10
+#define use_xor_move(screen_info) (screen_info->params->box_move && !screen_info->compositor_active)
+#define use_xor_resize(screen_info) (screen_info->params->box_resize && !screen_info->compositor_active)
 
 typedef struct _MoveResizeData MoveResizeData;
 struct _MoveResizeData
 {
     Client *c;
+    WireFrame *wireframe;
     gboolean use_keys;
     gboolean grab;
     gboolean is_transient;
@@ -868,7 +872,14 @@ clientMoveEventFilter (XEvent * xevent, gpointer data)
 
             if (screen_info->params->box_move)
             {
-                clientDrawOutline (c);
+                if (passdata->wireframe)
+                {
+                    wireframeUpdate  (c, passdata->wireframe);
+                }
+                else
+                {
+                    clientDrawOutline (c);
+                }
             }
 
             c->x = passdata->cancel_x;
@@ -894,7 +905,14 @@ clientMoveEventFilter (XEvent * xevent, gpointer data)
             }
             if (screen_info->params->box_move)
             {
-                clientDrawOutline (c);
+                if (passdata->wireframe)
+                {
+                    wireframeUpdate  (c, passdata->wireframe);
+                }
+                else
+                {
+                    clientDrawOutline (c);
+                }
             }
         }
         else if (passdata->use_keys)
@@ -914,13 +932,13 @@ clientMoveEventFilter (XEvent * xevent, gpointer data)
             /* Update the display time */
             myDisplayUpdateCurrentTime (display_info, xevent);
         }
-        if (!passdata->grab && screen_info->params->box_move)
+        if (!passdata->grab && use_xor_move(screen_info))
         {
             myDisplayGrabServer (display_info);
             passdata->grab = TRUE;
             clientDrawOutline (c);
         }
-        if (screen_info->params->box_move)
+        if (use_xor_move(screen_info))
         {
             clientDrawOutline (c);
         }
@@ -989,7 +1007,14 @@ clientMoveEventFilter (XEvent * xevent, gpointer data)
 #endif /* SHOW_POSITION */
         if (screen_info->params->box_move)
         {
-            clientDrawOutline (c);
+            if (passdata->wireframe)
+            {
+                wireframeUpdate  (c, passdata->wireframe);
+            }
+            else
+            {
+                clientDrawOutline (c);
+            }
         }
         else
         {
@@ -1082,6 +1107,7 @@ clientMove (Client * c, XEvent * ev)
     passdata.button = 0;
     passdata.is_transient = clientIsValidTransientOrModal (c);
     passdata.move_resized = FALSE;
+    passdata.wireframe = NULL;
 
     clientSaveSizePos (c);
 
@@ -1116,6 +1142,11 @@ clientMove (Client * c, XEvent * ev)
         return;
     }
 
+    if (screen_info->params->box_move && screen_info->compositor_active)
+    {
+        passdata.wireframe = wireframeCreate (c);
+    }
+
     passdata.poswin = NULL;
 #ifdef SHOW_POSITION
     passdata.poswin = poswinCreate(screen_info->gscr);
@@ -1161,6 +1192,11 @@ clientMove (Client * c, XEvent * ev)
     {
         clientDrawOutline (c);
     }
+
+    if (passdata.wireframe)
+    {
+        wireframeDelete (passdata.wireframe);
+    }
     /* Set window opacity to its original value */
     clientSetOpacity (c, c->opacity, OPACITY_MOVE, 0);
 
@@ -1399,7 +1435,7 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
             resizing = FALSE;
             passdata->released = passdata->use_keys;
 
-            if (screen_info->params->box_resize)
+            if (use_xor_resize(screen_info))
             {
                 clientDrawOutline (c);
             }
@@ -1411,7 +1447,14 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
             c->height = passdata->cancel_h;
             if (screen_info->params->box_resize)
             {
-                clientDrawOutline (c);
+                if (passdata->wireframe)
+                {
+                    wireframeUpdate  (c, passdata->wireframe);
+                }
+                else
+                {
+                    clientDrawOutline (c);
+                }
             }
             else
             {
@@ -1435,13 +1478,13 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
         {
             resizing = FALSE;
         }
-        if (!passdata->grab && screen_info->params->box_resize)
+        if (!passdata->grab && use_xor_resize(screen_info))
         {
             myDisplayGrabServer (display_info);
             passdata->grab = TRUE;
             clientDrawOutline (c);
         }
-        if (screen_info->params->box_resize)
+        if (use_xor_resize(screen_info))
         {
             clientDrawOutline (c);
         }
@@ -1515,7 +1558,14 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
         }
         if (screen_info->params->box_resize)
         {
-            clientDrawOutline (c);
+            if (passdata->wireframe)
+            {
+                wireframeUpdate  (c, passdata->wireframe);
+            }
+            else
+            {
+                clientDrawOutline (c);
+            }
         }
         else
         {
@@ -1604,6 +1654,7 @@ clientResize (Client * c, int handle, XEvent * ev)
     passdata.released = FALSE;
     passdata.button = 0;
     passdata.handle = handle;
+    passdata.wireframe = NULL;
     w_orig = c->width;
     h_orig = c->height;
 
@@ -1642,6 +1693,11 @@ clientResize (Client * c, int handle, XEvent * ev)
         return;
     }
 
+    if (screen_info->params->box_resize && screen_info->compositor_active)
+    {
+        passdata.wireframe = wireframeCreate (c);
+    }
+
     passdata.poswin = NULL;
 #ifndef SHOW_POSITION
     if ((c->size->width_inc > 1) || (c->size->height_inc > 1))
@@ -1683,6 +1739,11 @@ clientResize (Client * c, int handle, XEvent * ev)
     {
         clientDrawOutline (c);
     }
+    if (passdata.wireframe)
+    {
+        wireframeDelete (passdata.wireframe);
+    }
+
     /* Set window opacity to its original value */
     clientSetOpacity (c, c->opacity, OPACITY_RESIZE, 0);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list