[gtk+/client-side-windows: 58/284] Remove shape_combine_mask from backend. Make X11 backend use XShapeCombineMask directly to unset reg



commit e14e05addc8c26d8d6a44b284ac0c475f177e45a
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Dec 17 10:53:21 2008 +0100

    Remove shape_combine_mask from backend. Make X11 backend use XShapeCombineMask directly to unset region
---
 gdk/gdkoffscreenwindow.c |    9 ------
 gdk/gdkwindowimpl.h      |    4 --
 gdk/x11/gdkwindow-x11.c  |   73 ++++++++-------------------------------------
 3 files changed, 13 insertions(+), 73 deletions(-)

diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 9b17bf8..1fa7018 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -1002,14 +1002,6 @@ gdk_offscreen_window_set_back_pixmap (GdkWindow *window,
 }
 
 static void
-gdk_offscreen_window_shape_combine_mask (GdkWindow *window,
-                                         GdkBitmap *mask,
-                                         gint       x,
-                                         gint       y)
-{
-}
-
-static void
 gdk_offscreen_window_shape_combine_region (GdkWindow       *window,
                                            const GdkRegion *shape_region,
                                            gint             offset_x,
@@ -1177,7 +1169,6 @@ gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->reparent = gdk_offscreen_window_reparent;
   iface->set_cursor = gdk_offscreen_window_set_cursor;
   iface->get_geometry = gdk_offscreen_window_get_geometry;
-  iface->shape_combine_mask = gdk_offscreen_window_shape_combine_mask;
   iface->shape_combine_region = gdk_offscreen_window_shape_combine_region;
   iface->set_child_shapes = gdk_offscreen_window_set_child_shapes;
   iface->merge_child_shapes = gdk_offscreen_window_merge_child_shapes;
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index eff05b9..5b252a2 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -86,10 +86,6 @@ struct _GdkWindowImplIface
                                          gint            *x,
                                          gint            *y);
 
-  void         (* shape_combine_mask)   (GdkWindow       *window,
-                                         GdkBitmap       *mask,
-                                         gint             x,
-                                         gint             y);
   void         (* shape_combine_region) (GdkWindow       *window,
                                          const GdkRegion *shape_region,
                                          gint             offset_x,
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 85f81e5..90f3896 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -3375,63 +3375,6 @@ gdk_window_add_colormap_windows (GdkWindow *window)
     XFree (old_windows);
 }
 
-/*
- * This needs the X11 shape extension.
- * If not available, shaped windows will look
- * ugly, but programs still work.    Stefan Wille
- */
-static inline void
-do_shape_combine_mask (GdkWindow *window,
-		       GdkBitmap *mask,
-		       gint       x,
-		       gint       y,
-		       gint       shape)
-{
-  GdkWindowObject *private = (GdkWindowObject *)window;
-  Pixmap pixmap;
-  
-#ifdef HAVE_SHAPE_EXT
-  if (GDK_WINDOW_DESTROYED (window))
-    return;
-
-  if (shape == ShapeBounding
-      ? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
-      : gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
-    {
-      if (mask)
-	{
-	  pixmap = GDK_PIXMAP_XID (mask);
-	  
-	  private->shaped = (shape == ShapeBounding);
-	}
-      else
-	{
-	  x = 0;
-	  y = 0;
-	  pixmap = None;
-
-	  private->shaped = FALSE;
-	}
-      
-      XShapeCombineMask (GDK_WINDOW_XDISPLAY (window),
-			 GDK_WINDOW_XID (window),
-			 shape,
-			 x, y,
-			 pixmap,
-			 ShapeSet);
-    }
-#endif /* HAVE_SHAPE_EXT */
-}
-
-static void
-gdk_window_x11_shape_combine_mask (GdkWindow *window,
-                                   GdkBitmap *mask,
-                                   gint       x,
-                                   gint       y)
-{
-  do_shape_combine_mask (window, mask, x, y, ShapeBounding);
-}
-
 /**
  * gdk_window_input_shape_combine_mask:
  * @window: a #GdkWindow
@@ -3486,7 +3429,18 @@ do_shape_combine_region (GdkWindow       *window,
   if (shape_region == NULL)
     {
       /* Use NULL mask to unset the shape */
-      gdk_window_shape_combine_mask (window, NULL, 0, 0);
+      if (shape == ShapeBounding
+	  ? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
+	  : gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
+	{
+	  private->shaped = FALSE;
+	  XShapeCombineMask (GDK_WINDOW_XDISPLAY (window),
+			     GDK_WINDOW_XID (window),
+			     shape,
+			     0, 0,
+			     None,
+			     ShapeSet);
+	}
       return;
     }
   
@@ -4774,7 +4728,7 @@ xwindow_get_shape (Display *xdisplay,
 			     ShapeBounding, &rn, &ord);
 
   if (rn == 0)
-    return NULL;
+    return gdk_region_new (); /* Empty */
   
   if (ord != YXBanded)
     {
@@ -6007,7 +5961,6 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->get_geometry = gdk_window_x11_get_geometry;
   iface->get_origin = gdk_window_x11_get_origin;
   iface->get_deskrelative_origin = gdk_window_x11_get_deskrelative_origin;
-  iface->shape_combine_mask = gdk_window_x11_shape_combine_mask;
   iface->shape_combine_region = gdk_window_x11_shape_combine_region;
   iface->set_child_shapes = gdk_window_x11_set_child_shapes;
   iface->merge_child_shapes = gdk_window_x11_merge_child_shapes;



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