[metacity] require xsync and xshape at build time



commit 3c17d0a2e3d013caaa3f77ab74b40f1a42e07553
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Feb 9 21:46:58 2015 +0200

    require xsync and xshape at build time

 configure.ac                        |   68 ++------------------------------
 src/compositor/compositor-xrender.c |    2 -
 src/core/display-private.h          |   19 +--------
 src/core/display.c                  |   45 ++-------------------
 src/core/effects.c                  |   72 -----------------------------------
 src/core/main.c                     |   10 -----
 src/core/window-private.h           |    2 -
 src/core/window-props.c             |    2 -
 src/core/window.c                   |   16 --------
 src/core/xprops.c                   |   11 -----
 src/include/xprops.h                |    4 --
 src/ui/frames.c                     |    6 ---
 12 files changed, 13 insertions(+), 244 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bacf071..4bd84c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,21 +152,11 @@ AC_ARG_ENABLE(compositor,
                  [disable metacity's compositing manager]),,
   enable_compositor=auto)
 
-AC_ARG_ENABLE(xsync,
-  AC_HELP_STRING([--disable-xsync],
-                 [disable metacity's use of the XSync extension]),,
-  enable_xsync=auto)
-
 AC_ARG_ENABLE(render,
   AC_HELP_STRING([--disable-render],
                  [disable metacity's use of the RENDER extension]),,
   enable_render=auto)
 
-AC_ARG_ENABLE(shape,
-  AC_HELP_STRING([--disable-shape],
-                 [disable metacity's use of the shaped window extension]),,
-  enable_shape=auto)
-
 ## try definining HAVE_BACKTRACE
 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
 
@@ -310,7 +300,7 @@ PKG_CHECK_MODULES(METACITY, $METACITY_PC_MODULES)
 
 AC_PATH_XTRA
 
-ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+ALL_X_LIBS="-lX11 $X_EXTRA_LIBS"
 
 # Check for Xinerama extension (Solaris impl or Xfree impl)
 metacity_save_cppflags="$CPPFLAGS"
@@ -366,28 +356,6 @@ fi
 
 CPPFLAGS="$metacity_save_cppflags"
 
-SHAPE_LIBS=
-found_shape=no
-AC_CHECK_LIB(Xext, XShapeQueryExtension,
-               [AC_CHECK_HEADER(X11/extensions/shape.h,
-                                SHAPE_LIBS=-lXext found_shape=yes)],
-               , $ALL_X_LIBS)
-
-if test x$enable_shape = xno; then
-   found_shape=no
-fi
-
-if test x$enable_shape = xyes; then
-   if test "$found_shape" = "no"; then
-      AC_MSG_ERROR([--enable-shape forced and Shape not found])
-      exit 1
-   fi
-fi
-
-if test "x$found_shape" = "xyes"; then
-   AC_DEFINE(HAVE_SHAPE, , [Have the shape extension library])
-fi
-
 found_xkb=no
 AC_CHECK_LIB(X11, XkbQueryExtension,
                [AC_CHECK_HEADER(X11/XKBlib.h,
@@ -411,34 +379,10 @@ if test "x$found_randr" = "xyes"; then
    AC_DEFINE(HAVE_RANDR, , [Have the Xrandr extension library])
 fi
 
-XSYNC_LIBS=
-found_xsync=no
-AC_CHECK_LIB(Xext, XSyncQueryExtension,
-               [AC_CHECK_HEADER(X11/extensions/sync.h,
-                                found_xsync=yes,,
-                               [#include <X11/Xlib.h>])],
-               , $ALL_X_LIBS)
-
-if test x$enable_xsync = xno; then
-   found_xsync=no
-fi
-
-if test x$enable_xsync = xyes; then
-   if test "$found_xsync" = "no"; then
-      AC_MSG_ERROR([--enable-xsync forced and XSync not found])
-      exit 1
-   fi
-fi
-
-if test "x$found_xsync" = "xyes"; then
-   XSYNC_LIBS=-lXext
-   AC_DEFINE(HAVE_XSYNC, , [Have the Xsync extension library])
-fi
-
-METACITY_LIBS="$ALL_LIBS $METACITY_LIBS $XSYNC_LIBS $RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 
$X_EXTRA_LIBS -lm"
-METACITY_MESSAGE_LIBS="$METACITY_MESSAGE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
-METACITY_WINDOW_DEMO_LIBS="$METACITY_WINDOW_DEMO_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
-METACITY_PROPS_LIBS="$METACITY_PROPS_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+METACITY_LIBS="$ALL_LIBS $METACITY_LIBS $RANDR_LIBS -lX11 -lXext $X_EXTRA_LIBS -lm"
+METACITY_MESSAGE_LIBS="$METACITY_MESSAGE_LIBS -lX11 $X_EXTRA_LIBS"
+METACITY_WINDOW_DEMO_LIBS="$METACITY_WINDOW_DEMO_LIBS -lX11 $X_EXTRA_LIBS"
+METACITY_PROPS_LIBS="$METACITY_PROPS_LIBS -lX11 $X_EXTRA_LIBS"
 
 found_sm=no
 case "$METACITY_LIBS" in
@@ -536,9 +480,7 @@ metacity-$VERSION (using gtk+-${GTK_API_VERSION}):
        Startup notification:     ${have_startup_notification}
        Compositing manager:      ${have_xcomposite}
        Session management:       ${found_sm}
-       Shape extension:          ${found_shape}
        Resize-and-rotate:        ${found_randr}
-       Xsync:                    ${found_xsync}
        Render:                   ${have_xrender}
        Xcursor:                  ${have_xcursor}
 "
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 054c802..1b62cda 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -2841,10 +2841,8 @@ xrender_process_event (MetaCompositor *compositor,
     default:
       if (event->type == meta_display_get_damage_event_base (xrc->display) + XDamageNotify)
         process_damage (xrc, (XDamageNotifyEvent *) event);
-#ifdef HAVE_SHAPE
       else if (event->type == meta_display_get_shape_event_base (xrc->display) + ShapeNotify)
         process_shape (xrc, (XShapeEvent *) event);
-#endif /* HAVE_SHAPE */
       else
         {
           meta_error_trap_pop (xrc->display, FALSE);
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 2c7e703..85c98f8 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -40,9 +40,7 @@
 #include <libsn/sn.h>
 #endif
 
-#ifdef HAVE_XSYNC
 #include <X11/extensions/sync.h>
-#endif
 
 typedef struct _MetaKeyBinding MetaKeyBinding;
 typedef struct _MetaStack      MetaStack;
@@ -204,10 +202,8 @@ struct _MetaDisplay
   int         xkb_base_event_type;
   guint32     last_bell_time;
 #endif
-#ifdef HAVE_XSYNC
   /* alarm monitoring client's _NET_WM_SYNC_REQUEST_COUNTER */
   XSyncAlarm  grab_sync_request_alarm;
-#endif
   int        grab_resize_timeout_id;
 
   /* Keybindings stuff */
@@ -256,14 +252,11 @@ struct _MetaDisplay
 #ifdef HAVE_STARTUP_NOTIFICATION
   SnDisplay *sn_display;
 #endif
-#ifdef HAVE_XSYNC
+
   int xsync_event_base;
   int xsync_error_base;
-#endif
-#ifdef HAVE_SHAPE
   int shape_event_base;
   int shape_error_base;
-#endif
 #ifdef HAVE_RENDER
   int render_event_base;
   int render_error_base;
@@ -276,18 +269,12 @@ struct _MetaDisplay
   int xfixes_event_base;
   int xfixes_error_base;
 #endif
-#ifdef HAVE_XSYNC
+
   unsigned int have_xsync : 1;
 #define META_DISPLAY_HAS_XSYNC(display) ((display)->have_xsync)
-#else
-#define META_DISPLAY_HAS_XSYNC(display) FALSE
-#endif
-#ifdef HAVE_SHAPE
   unsigned int have_shape : 1;
 #define META_DISPLAY_HAS_SHAPE(display) ((display)->have_shape)
-#else
-#define META_DISPLAY_HAS_SHAPE(display) FALSE
-#endif
+
 #ifdef HAVE_RENDER
   unsigned int have_render : 1;
 #define META_DISPLAY_HAS_RENDER(display) ((display)->have_render)
diff --git a/src/core/display.c b/src/core/display.c
index 6db6674..8456f9b 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -57,9 +57,7 @@
 #ifdef HAVE_RANDR
 #include <X11/extensions/Xrandr.h>
 #endif
-#ifdef HAVE_SHAPE
 #include <X11/extensions/shape.h>
-#endif
 #ifdef HAVE_RENDER
 #include <X11/extensions/Xrender.h>
 #endif
@@ -372,9 +370,7 @@ meta_display_open (void)
   the_display->allow_terminal_deactivation = TRUE; /* Only relevant for when a
                                                   terminal has the focus */
 
-#ifdef HAVE_XSYNC
   the_display->grab_sync_request_alarm = None;
-#endif
 
   /* FIXME copy the checks from GDK probably */
   the_display->static_gravity_works = g_getenv ("METACITY_USE_STATIC_GRAVITY") != NULL;
@@ -462,7 +458,6 @@ meta_display_open (void)
 
   the_display->grab_edge_resistance_data = NULL;
 
-#ifdef HAVE_XSYNC
   {
     int major, minor;
 
@@ -492,12 +487,7 @@ meta_display_open (void)
                   the_display->xsync_error_base,
                   the_display->xsync_event_base);
   }
-#else  /* HAVE_XSYNC */
-  meta_verbose ("Not compiled with Xsync support\n");
-#endif /* !HAVE_XSYNC */
 
-
-#ifdef HAVE_SHAPE
   {
     the_display->have_shape = FALSE;
 
@@ -518,9 +508,6 @@ meta_display_open (void)
                   the_display->shape_error_base,
                   the_display->shape_event_base);
   }
-#else  /* HAVE_SHAPE */
-  meta_verbose ("Not compiled with Shape support\n");
-#endif /* !HAVE_SHAPE */
 
 #ifdef HAVE_RENDER
   {
@@ -1466,7 +1453,6 @@ event_callback (XEvent   *event,
                   window->desc);
     }
 
-#ifdef HAVE_XSYNC
   if (META_DISPLAY_HAS_XSYNC (display) &&
       event->type == (display->xsync_event_base + XSyncAlarmNotify) &&
       ((XSyncAlarmNotifyEvent*)event)->alarm == display->grab_sync_request_alarm)
@@ -1478,9 +1464,7 @@ event_callback (XEvent   *event,
           grab_op_is_mouse (display->grab_op))
        meta_window_handle_mouse_grab_op_event (display->grab_window, event);
     }
-#endif /* HAVE_XSYNC */
 
-#ifdef HAVE_SHAPE
   if (META_DISPLAY_HAS_SHAPE (display) &&
       event->type == (display->shape_event_base + ShapeNotify))
     {
@@ -1529,7 +1513,6 @@ event_callback (XEvent   *event,
                       frame_was_receiver);
         }
     }
-#endif /* HAVE_SHAPE */
 
   if (window && ((event->type == KeyPress) || (event->type == ButtonPress)))
     {
@@ -2435,14 +2418,12 @@ event_get_modified_window (MetaDisplay *display,
       return None;
 
     default:
-#ifdef HAVE_SHAPE
       if (META_DISPLAY_HAS_SHAPE (display) &&
           event->type == (display->shape_event_base + ShapeNotify))
         {
           XShapeEvent *sev = (XShapeEvent*) event;
           return sev->window;
         }
-#endif
 
       return None;
     }
@@ -2610,7 +2591,6 @@ key_event_description (Display *xdisplay,
 }
 #endif /* WITH_VERBOSE_MODE */
 
-#ifdef HAVE_XSYNC
 #ifdef WITH_VERBOSE_MODE
 static gint64
 sync_value_to_64 (const XSyncValue *value)
@@ -2642,8 +2622,6 @@ alarm_state_to_string (XSyncAlarmState state)
 }
 #endif /* WITH_VERBOSE_MODE */
 
-#endif /* HAVE_XSYNC */
-
 #ifdef WITH_VERBOSE_MODE
 static void
 meta_spew_event (MetaDisplay *display,
@@ -2896,7 +2874,6 @@ meta_spew_event (MetaDisplay *display,
       name = "MappingNotify";
       break;
     default:
-#ifdef HAVE_XSYNC
       if (META_DISPLAY_HAS_XSYNC (display) &&
           event->type == (display->xsync_event_base + XSyncAlarmNotify))
         {
@@ -2914,12 +2891,9 @@ meta_spew_event (MetaDisplay *display,
                              (unsigned int)aevent->time,
                              alarm_state_to_string (aevent->state));
         }
-      else
-#endif /* HAVE_XSYNC */
-#ifdef HAVE_SHAPE
-        if (META_DISPLAY_HAS_SHAPE (display) &&
-            event->type == (display->shape_event_base + ShapeNotify))
-          {
+      else if (META_DISPLAY_HAS_SHAPE (display) &&
+               event->type == (display->shape_event_base + ShapeNotify))
+        {
             XShapeEvent *sev = (XShapeEvent*) event;
 
             name = "ShapeNotify";
@@ -2934,9 +2908,8 @@ meta_spew_event (MetaDisplay *display,
                                "ShapeClip" : "(unknown)"),
                                sev->x, sev->y, sev->width, sev->height,
                                sev->shaped);
-          }
-        else
-#endif /* HAVE_SHAPE */
+        }
+      else
         {
           name = "(Unknown event)";
           extra = g_strdup_printf ("type: %d", event->xany.type);
@@ -3312,10 +3285,8 @@ meta_display_begin_grab_op (MetaDisplay *display,
   display->grab_last_moveresize_time.tv_usec = 0;
   display->grab_motion_notify_time = 0;
   display->grab_old_window_stacking = NULL;
-#ifdef HAVE_XSYNC
   display->grab_sync_request_alarm = None;
   display->grab_last_user_action_was_snap = FALSE;
-#endif
   display->grab_was_cancelled = FALSE;
   display->grab_frame_action = frame_action;
 
@@ -3342,7 +3313,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
           meta_window_begin_wireframe (window);
         }
 
-#ifdef HAVE_XSYNC
       if (!display->grab_wireframe_active &&
           meta_grab_op_is_resizing (display->grab_op) &&
           display->grab_window->sync_request_counter != None)
@@ -3395,7 +3365,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
                       "Created update alarm 0x%lx\n",
                       display->grab_sync_request_alarm);
         }
-#endif
     }
 
   meta_topic (META_DEBUG_WINDOW_OPS,
@@ -3588,14 +3557,12 @@ meta_display_end_grab_op (MetaDisplay *display,
         meta_screen_ungrab_all_keys (display->grab_screen, timestamp);
     }
 
-#ifdef HAVE_XSYNC
   if (display->grab_sync_request_alarm != None)
     {
       XSyncDestroyAlarm (display->xdisplay,
                          display->grab_sync_request_alarm);
       display->grab_sync_request_alarm = None;
     }
-#endif /* HAVE_XSYNC */
 
   /* Hide the tile preview if it exists */
   if (display->grab_screen->tile_preview)
@@ -5180,11 +5147,9 @@ meta_display_get_damage_event_base (MetaDisplay *display)
 #endif
 
 #ifdef HAVE_COMPOSITE_EXTENSIONS
-#ifdef HAVE_SHAPE
 int
 meta_display_get_shape_event_base (MetaDisplay *display)
 {
   return display->shape_event_base;
 }
 #endif
-#endif
diff --git a/src/core/effects.c b/src/core/effects.c
index 8723509..e3c6dcd 100644
--- a/src/core/effects.c
+++ b/src/core/effects.c
@@ -60,9 +60,7 @@
 #include "window-private.h"
 #include "prefs.h"
 
-#ifdef HAVE_SHAPE
 #include <X11/extensions/shape.h>
-#endif
 
 #define META_MINIMIZE_ANIMATION_LENGTH 0.25
 #define META_SHADE_ANIMATION_LENGTH 0.2
@@ -79,19 +77,8 @@ typedef struct
   double millisecs_duration;
   GTimeVal start_time;
 
-#ifdef HAVE_SHAPE
   /** For wireframe window */
   Window wireframe_xwindow;
-#else
-  /** Rectangle to erase */
-  MetaRectangle last_rect;
-
-  /** First time we've plotted anything in this animation? */
-  gboolean first_time;
-
-  /** For wireframe drawn on root window */
-  GC gc;
-#endif
 
   MetaRectangle start_rect;
   MetaRectangle end_rect;
@@ -258,7 +245,6 @@ meta_effect_run_close (MetaWindow         *window,
 
 /* old ugly minimization effect */
 
-#ifdef HAVE_SHAPE
 static void
 update_wireframe_window (MetaDisplay         *display,
                          Window               xwindow,
@@ -310,7 +296,6 @@ update_wireframe_window (MetaDisplay         *display,
                          ShapeBounding, 0, 0, None, ShapeSet);
     }
 }
-#endif
 
 /**
  * A hack to force the X server to synchronize with the
@@ -337,21 +322,6 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
   MetaRectangle draw_rect;
   double fraction;
 
-#ifndef HAVE_SHAPE
-  if (!context->first_time)
-    {
-       /* Restore the previously drawn background */
-       XDrawRectangle (context->screen->display->xdisplay,
-                       context->screen->xroot,
-                       context->gc,
-                       context->last_rect.x, context->last_rect.y,
-                       context->last_rect.width, context->last_rect.height);
-    }
-  else
-    context->first_time = FALSE;
-
-#endif /* !HAVE_SHAPE */
-
   g_get_current_time (&current_time);
 
   /* We use milliseconds for all times */
@@ -369,15 +339,8 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
   if (elapsed > context->millisecs_duration)
     {
       /* All done */
-#ifdef HAVE_SHAPE
         XDestroyWindow (context->screen->display->xdisplay,
                           context->wireframe_xwindow);
-#else
-        meta_display_ungrab (context->screen->display);
-        meta_ui_pop_delay_exposes (context->screen->ui);
-        XFreeGC (context->screen->display->xdisplay,
-                 context->gc);
-#endif /* !HAVE_SHAPE */
 
       graphics_sync (context);
 
@@ -402,21 +365,9 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
   if (draw_rect.height < 1)
     draw_rect.height = 1;
 
-#ifdef HAVE_SHAPE
   update_wireframe_window (context->screen->display,
                            context->wireframe_xwindow,
                            &draw_rect);
-#else
-  context->last_rect = draw_rect;
-
-  /* Draw the rectangle */
-  XDrawRectangle (context->screen->display->xdisplay,
-                  context->screen->xroot,
-                  context->gc,
-                  draw_rect.x, draw_rect.y,
-                  draw_rect.width, draw_rect.height);
-
-#endif /* !HAVE_SHAPE */
 
   /* kick changes onto the server */
   graphics_sync (context);
@@ -431,12 +382,7 @@ draw_box_animation (MetaScreen     *screen,
                     double          seconds_duration)
 {
   BoxAnimationContext *context;
-
-#ifdef HAVE_SHAPE
   XSetWindowAttributes attrs;
-#else
-  XGCValues gc_values;
-#endif
 
   g_return_if_fail (seconds_duration > 0.0);
 
@@ -453,8 +399,6 @@ draw_box_animation (MetaScreen     *screen,
   context->start_rect = *initial_rect;
   context->end_rect = *destination_rect;
 
-#ifdef HAVE_SHAPE
-
   attrs.override_redirect = True;
   attrs.background_pixel = BlackPixel (screen->display->xdisplay,
                                        screen->number);
@@ -479,22 +423,6 @@ draw_box_animation (MetaScreen     *screen,
   XMapWindow (screen->display->xdisplay,
               context->wireframe_xwindow);
 
-#else /* !HAVE_SHAPE */
-
-  context->first_time = TRUE;
-  gc_values.subwindow_mode = IncludeInferiors;
-  gc_values.function = GXinvert;
-
-  context->gc = XCreateGC (screen->display->xdisplay,
-                           screen->xroot,
-                           GCSubwindowMode | GCFunction,
-                           &gc_values);
-
-  /* Grab the X server to avoid screen dirt */
-  meta_display_grab (context->screen->display);
-  meta_ui_push_delay_exposes (context->screen->ui);
-#endif
-
   /* Do this only after we get the pixbuf from the server,
    * so that the animation doesn't get truncated.
    */
diff --git a/src/core/main.c b/src/core/main.c
index 6758ae7..d591a44 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -143,11 +143,6 @@ version (void)
 static void
 meta_print_compilation_info (void)
 {
-#ifdef HAVE_SHAPE
-  meta_verbose ("Compiled with shape extension\n");
-#else
-  meta_verbose ("Compiled without shape extension\n");
-#endif
 #ifdef HAVE_XINERAMA
   meta_topic (META_DEBUG_XINERAMA, "Compiled with Xinerama extension\n");
 #else
@@ -163,11 +158,6 @@ meta_print_compilation_info (void)
 #else
   meta_topic (META_DEBUG_XINERAMA, " (not using Solaris Xinerama)\n");
 #endif
-#ifdef HAVE_XSYNC
-  meta_verbose ("Compiled with sync extension\n");
-#else
-  meta_verbose ("Compiled without sync extension\n");
-#endif
 #ifdef HAVE_RANDR
   meta_verbose ("Compiled with randr extension\n");
 #else
diff --git a/src/core/window-private.h b/src/core/window-private.h
index aa12e3c..f76bf6e 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -322,12 +322,10 @@ struct _MetaWindow
   /* Note: can be NULL */
   GSList *struts;
 
-#ifdef HAVE_XSYNC
   /* XSync update counter */
   XSyncCounter sync_request_counter;
   guint sync_request_serial;
   GTimeVal sync_request_time;
-#endif
 
   /* Number of UnmapNotify that are caused by us, if
    * we get UnmapNotify with none pending then the client
diff --git a/src/core/window-props.c b/src/core/window-props.c
index e688ca7..5fdc452 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -1051,13 +1051,11 @@ reload_update_counter (MetaWindow    *window,
 {
   if (value->type != META_PROP_VALUE_INVALID)
     {
-#ifdef HAVE_XSYNC
       XSyncCounter counter = value->v.xcounter;
 
       window->sync_request_counter = counter;
       meta_verbose ("Window has _NET_WM_SYNC_REQUEST_COUNTER 0x%lx\n",
                     window->sync_request_counter);
-#endif
     }
 }
 
diff --git a/src/core/window.c b/src/core/window.c
index 66af415..be9094f 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -48,9 +48,7 @@
 #include <X11/Xlibint.h> /* For display->resource_mask */
 #include <string.h>
 
-#ifdef HAVE_SHAPE
 #include <X11/extensions/shape.h>
-#endif
 
 static int destroying_windows_disallowed = 0;
 
@@ -323,7 +321,6 @@ meta_window_new_with_attrs (MetaDisplay       *display,
   XSelectInput (display->xdisplay, xwindow, event_mask);
 
   has_shape = FALSE;
-#ifdef HAVE_SHAPE
   if (META_DISPLAY_HAS_SHAPE (display))
     {
       int x_bounding, y_bounding, x_clip, y_clip;
@@ -345,7 +342,6 @@ meta_window_new_with_attrs (MetaDisplay       *display,
                   has_shape, x_bounding, y_bounding,
                   w_bounding, h_bounding);
     }
-#endif
 
   /* Get rid of any borders */
   if (attrs->border_width != 0)
@@ -389,12 +385,10 @@ meta_window_new_with_attrs (MetaDisplay       *display,
   window->display = display;
   window->workspace = NULL;
 
-#ifdef HAVE_XSYNC
   window->sync_request_counter = None;
   window->sync_request_serial = 0;
   window->sync_request_time.tv_sec = 0;
   window->sync_request_time.tv_usec = 0;
-#endif
 
   window->screen = NULL;
   tmp = display->screens;
@@ -1162,10 +1156,8 @@ meta_window_free (MetaWindow  *window,
       window->user_time_window = None;
     }
 
-#ifdef HAVE_SHAPE
   if (META_DISPLAY_HAS_SHAPE (window->display))
     XShapeSelectInput (window->display->xdisplay, window->xwindow, NoEventMask);
-#endif
 
   meta_error_trap_pop (window->display, FALSE);
 
@@ -3258,7 +3250,6 @@ static_gravity_works (MetaDisplay *display)
   return display->static_gravity_works;
 }
 
-#ifdef HAVE_XSYNC
 static void
 send_sync_request (MetaWindow *window)
 {
@@ -3291,7 +3282,6 @@ send_sync_request (MetaWindow *window)
 
   g_get_current_time (&window->sync_request_time);
 }
-#endif
 
 static gboolean
 move_attached_dialog (MetaWindow *window,
@@ -3696,7 +3686,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
 
       meta_error_trap_push (window->display);
 
-#ifdef HAVE_XSYNC
       if (window->sync_request_counter != None &&
          window->display->grab_sync_request_alarm != None &&
          window->sync_request_time.tv_usec == 0 &&
@@ -3708,7 +3697,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
 
          send_sync_request (window);
        }
-#endif
 
       XConfigureWindow (window->display->xdisplay,
                         window->xwindow,
@@ -6913,7 +6901,6 @@ check_moveresize_frequency (MetaWindow *window,
 
   g_get_current_time (&current_time);
 
-#ifdef HAVE_XSYNC
   if (!window->disable_sync &&
       window->display->grab_sync_request_alarm != None)
     {
@@ -6951,7 +6938,6 @@ check_moveresize_frequency (MetaWindow *window,
        }
     }
   else
-#endif /* HAVE_XSYNC */
     {
       const double max_resizes_per_second = 25.0;
       const double ms_between_resizes = 1000.0 / max_resizes_per_second;
@@ -7570,7 +7556,6 @@ void
 meta_window_handle_mouse_grab_op_event (MetaWindow *window,
                                         XEvent     *event)
 {
-#ifdef HAVE_XSYNC
   if (event->type == (window->display->xsync_event_base + XSyncAlarmNotify))
     {
       meta_topic (META_DEBUG_RESIZING,
@@ -7617,7 +7602,6 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
           break;
         }
     }
-#endif /* HAVE_XSYNC */
 
   switch (event->type)
     {
diff --git a/src/core/xprops.c b/src/core/xprops.c
index 8b162d7..4ef8847 100644
--- a/src/core/xprops.c
+++ b/src/core/xprops.c
@@ -562,7 +562,6 @@ window_from_results (GetPropertyResults *results,
   return TRUE;
 }
 
-#ifdef HAVE_XSYNC
 static gboolean
 counter_from_results (GetPropertyResults *results,
                       XSyncCounter       *counter_p)
@@ -578,7 +577,6 @@ counter_from_results (GetPropertyResults *results,
 
   return TRUE;
 }
-#endif
 
 gboolean
 meta_prop_get_window (MetaDisplay *display,
@@ -1186,18 +1184,9 @@ meta_prop_get_values (MetaDisplay   *display,
             values[i].type = META_PROP_VALUE_INVALID;
           break;
         case META_PROP_VALUE_SYNC_COUNTER:
-#ifdef HAVE_XSYNC
           if (!counter_from_results (&results,
                                      &values[i].v.xcounter))
             values[i].type = META_PROP_VALUE_INVALID;
-#else
-          values[i].type = META_PROP_VALUE_INVALID;
-          if (results.prop)
-            {
-              XFree (results.prop);
-              results.prop = NULL;
-            }
-#endif
           break;
         }
 
diff --git a/src/include/xprops.h b/src/include/xprops.h
index 2128f86..e037325 100644
--- a/src/include/xprops.h
+++ b/src/include/xprops.h
@@ -27,9 +27,7 @@
 #include "display.h"
 #include <X11/Xutil.h>
 
-#ifdef HAVE_XSYNC
 #include <X11/extensions/sync.h>
-#endif
 
 /* Copied from Lesstif by way of GTK. Rudimentary docs can be
  * found in some Motif reference guides online.
@@ -173,9 +171,7 @@ typedef struct
     gulong cardinal;
     XWMHints *wm_hints;
     XClassHint class_hint;
-#ifdef HAVE_XSYNC
     XSyncCounter xcounter;
-#endif
 
     struct
     {
diff --git a/src/ui/frames.c b/src/ui/frames.c
index c79b4ac..f3e1a1d 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -36,9 +36,7 @@
 
 #include <cairo-xlib.h>
 
-#ifdef HAVE_SHAPE
 #include <X11/extensions/shape.h>
-#endif
 
 #define DEFAULT_INNER_BUTTON_BORDER 3
 
@@ -823,7 +821,6 @@ meta_frames_get_corner_radiuses (MetaFrames *frames,
                                      bottom_left, bottom_right);
 }
 
-#ifdef HAVE_SHAPE
 static void
 apply_cairo_region_to_window (Display        *display,
                               Window          xwindow,
@@ -855,7 +852,6 @@ apply_cairo_region_to_window (Display        *display,
 
   g_free (rects);
 }
-#endif
 
 /* The client rectangle surrounds client window; it subtracts both
  * the visible and invisible borders from the frame window's size.
@@ -1018,7 +1014,6 @@ meta_frames_apply_shapes (MetaFrames *frames,
                           int         new_window_height,
                           gboolean    window_has_shape)
 {
-#ifdef HAVE_SHAPE
   /* Apply shapes as if window had new_window_width, new_window_height */
   MetaUIFrame *frame;
   MetaFrameGeometry fgeom;
@@ -1183,7 +1178,6 @@ meta_frames_apply_shapes (MetaFrames *frames,
   frame->shape_applied = TRUE;
 
   cairo_region_destroy (window_region);
-#endif /* HAVE_SHAPE */
 }
 
 cairo_region_t *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]