[Xfce4-commits] [xfce/xfwm4] 04/05: Fix build with compositor disabled

noreply at xfce.org noreply at xfce.org
Sat Jan 24 22:41:08 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 2bb44c1ee89733390201c4db655bfc6ee64a6247
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Sat Jan 24 22:01:49 2015 +0100

    Fix build with compositor disabled
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/compositor.c |   11 +++++++++++
 src/compositor.h |    1 +
 src/events.c     |    8 ++++----
 src/moveresize.c |   11 ++++++-----
 src/wireframe.c  |   10 +++++-----
 5 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 8aafa30..fba8dc5 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2880,6 +2880,17 @@ compositorIsUsable (DisplayInfo *display_info)
     return FALSE;
 }
 
+gboolean
+compositorIsActive (ScreenInfo *screen_info)
+{
+#ifdef HAVE_COMPOSITOR
+    g_return_val_if_fail (screen_info != NULL, FALSE);
+
+    return screen_info->compositor_active;
+#endif /* HAVE_COMPOSITOR */
+    return FALSE;
+}
+
 void
 compositorAddWindow (DisplayInfo *display_info, Window id, Client *c)
 {
diff --git a/src/compositor.h b/src/compositor.h
index b5818ea..6629f3e 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -35,6 +35,7 @@
 #include "client.h"
 
 gboolean                 compositorIsUsable                     (DisplayInfo *);
+gboolean                 compositorIsActive                     (ScreenInfo *);
 void                     compositorAddWindow                    (DisplayInfo *,
                                                                  Window,
                                                                  Client *);
diff --git a/src/events.c b/src/events.c
index db4e836..193f163 100644
--- a/src/events.c
+++ b/src/events.c
@@ -820,7 +820,7 @@ titleButton (Client * c, guint state, XButtonEvent * ev)
     {
         /* Mouse wheel scroll up */
 #ifdef HAVE_COMPOSITOR
-        if ((state) && (state == screen_info->params->easy_click) && (screen_info->compositor_active))
+        if ((state) && (state == screen_info->params->easy_click) && compositorIsActive (screen_info))
         {
             clientIncOpacity(c);
         }
@@ -838,7 +838,7 @@ titleButton (Client * c, guint state, XButtonEvent * ev)
     {
         /* Mouse wheel scroll down */
 #ifdef HAVE_COMPOSITOR
-        if ((state) && (state == screen_info->params->easy_click) && (screen_info->compositor_active))
+        if ((state) && (state == screen_info->params->easy_click) && compositorIsActive (screen_info))
         {
             clientDecOpacity(c);
         }
@@ -929,12 +929,12 @@ handleButtonPress (DisplayInfo *display_info, XButtonEvent * ev)
         }
 #ifdef HAVE_COMPOSITOR
         else if ((ev->button == Button4) && (screen_info->params->zoom_desktop) && (state) &&
-                 (state == screen_info->params->easy_click) && (screen_info->compositor_active))
+                 (state == screen_info->params->easy_click) && compositorIsActive (screen_info))
         {
             compositorZoomIn(screen_info, ev);
         }
         else if ((ev->button == Button5) && (screen_info->params->zoom_desktop) && (state) &&
-                 (state == screen_info->params->easy_click) && (screen_info->compositor_active))
+                 (state == screen_info->params->easy_click) && compositorIsActive (screen_info))
         {
             compositorZoomOut(screen_info, ev);
         }
diff --git a/src/moveresize.c b/src/moveresize.c
index aa8d0b9..08c68b1 100644
--- a/src/moveresize.c
+++ b/src/moveresize.c
@@ -17,7 +17,7 @@
 
 
         oroborus - (c) 2001 Ken Lynch
-        xfwm4    - (c) 2002-2011 Olivier Fourdan
+        xfwm4    - (c) 2002-2015 Olivier Fourdan
 
  */
 
@@ -37,6 +37,7 @@
 #include <gtk/gtk.h>
 
 #include "client.h"
+#include "compositor.h"
 #include "focus.h"
 #include "frame.h"
 #include "moveresize.h"
@@ -58,8 +59,8 @@
 
 #define TILE_DISTANCE 10
 #define BORDER_TILE_LENGTH_RELATIVE 5
-#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)
+#define use_xor_move(screen_info) (screen_info->params->box_move && !compositorIsActive (screen_info))
+#define use_xor_resize(screen_info) (screen_info->params->box_resize && !compositorIsActive (screen_info))
 
 typedef struct _MoveResizeData MoveResizeData;
 struct _MoveResizeData
@@ -1207,7 +1208,7 @@ clientMove (Client * c, XEvent * ev)
         return;
     }
 
-    if (screen_info->params->box_move && screen_info->compositor_active)
+    if (screen_info->params->box_move && compositorIsActive (screen_info))
     {
         passdata.wireframe = wireframeCreate (c);
     }
@@ -1761,7 +1762,7 @@ clientResize (Client * c, int handle, XEvent * ev)
         return;
     }
 
-    if (screen_info->params->box_resize && screen_info->compositor_active)
+    if (screen_info->params->box_resize && compositorIsActive (screen_info))
     {
         passdata.wireframe = wireframeCreate (c);
     }
diff --git a/src/wireframe.c b/src/wireframe.c
index 079d5d5..bb70a2f 100644
--- a/src/wireframe.c
+++ b/src/wireframe.c
@@ -17,7 +17,7 @@
 
 
         metacity - (c) 2001 Anders Carlsson, Havoc Pennington
-        xfwm4    - (c) 2002-2011 Olivier Fourdan
+        xfwm4    - (c) 2002-2015 Olivier Fourdan
 
  */
 
@@ -172,7 +172,7 @@ wireframeUpdate (Client *c, WireFrame *wireframe)
     wireframe->y = frameExtentY (c);
 
     screen_info = wireframe->screen_info;
-    if (screen_info->compositor_active)
+    if (compositorIsActive (screen_info))
     {
          wireframeDrawCairo (wireframe, frameExtentWidth (c), frameExtentHeight (c));
     }
@@ -230,9 +230,9 @@ wireframeCreate (Client *c)
     wireframe->height = 0;
     wireframe->cr = NULL;
     wireframe->surface = NULL;
-    wireframe->alpha = (screen_info->compositor_active ? 0.5 : 1.0);
+    wireframe->alpha = (compositorIsActive (screen_info) ? 0.5 : 1.0);
 
-    if (screen_info->compositor_active &&
+    if (compositorIsActive (screen_info) &&
         XMatchVisualInfo (myScreenGetXDisplay (screen_info), screen_info->screen,
                           32, TrueColor, &xvisual_info))
     {
@@ -261,7 +261,7 @@ wireframeCreate (Client *c)
                                         CWOverrideRedirect | CWColormap | CWBackPixel | CWBorderPixel,
                                         &attrs);
 
-    if (screen_info->compositor_active)
+    if (compositorIsActive (screen_info))
     {
         /* Cairo */
         wireframeInitColor (wireframe);

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


More information about the Xfce4-commits mailing list