[gtk+/client-side-windows: 195/284] Remove_gdk_pixmap_set_as_backing etc, as this is not used anymore



commit 8de6ae26e40569dd15a3316ffdf62466490633ef
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Jan 27 15:38:39 2009 +0100

    Remove_gdk_pixmap_set_as_backing etc, as this is not used anymore
    
    We don't copy from a window to a pixmap anymore, so all the code
    for this can be removed.
---
 gdk/gdkinternals.h      |    5 -----
 gdk/gdkpixmap.c         |   27 ---------------------------
 gdk/gdkpixmap.h         |    3 ---
 gdk/x11/gdkevents-x11.c |   32 ++++----------------------------
 4 files changed, 4 insertions(+), 63 deletions(-)

diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 781a799..dc7fec8 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -269,11 +269,6 @@ GdkPixmap *_gdk_bitmap_create_from_data  (GdkDrawable    *drawable,
                                           const gchar    *data,
                                           gint            width,
                                           gint            height);
-void       _gdk_pixmap_set_as_backing    (GdkPixmap      *pixmap,
-					  GdkWindow      *window,
-					  int             x_offset,
-					  int             y_offset);
-					  
 
 void       _gdk_window_impl_new          (GdkWindow      *window,
 					  GdkWindow      *real_parent,
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index f52bc8c..de735b9 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -229,9 +229,6 @@ gdk_pixmap_finalize (GObject *object)
 
   g_object_unref (obj->impl);
   obj->impl = NULL;
-
-  if (obj->backing_for)
-    g_object_unref (obj->backing_for);
   
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -284,30 +281,6 @@ gdk_pixmap_create_from_data (GdkDrawable    *drawable,
 }
 
 
-/* Make GraphicsExposures and NoExposures and similar things report
- * events on this window. Make sure to ref the pixmap for each operation
- * that will result in a GraphicsExposure, because the core code will unref
- * if for each such event. This is so that the pixmap live long enought to
- * get the events on the window.
- */
-void
-_gdk_pixmap_set_as_backing (GdkPixmap      *pixmap,
-			    GdkWindow      *window,
-			    int             x_offset,
-			    int             y_offset)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)pixmap;
-
-  if (private->backing_for)
-    g_object_unref (private->backing_for);
-  private->backing_for = window;
-  if (private->backing_for)
-    g_object_ref (private->backing_for);
-  private->backing_x_offset = x_offset;
-  private->backing_y_offset = y_offset;
-  
-}
-
 static GdkGC *
 gdk_pixmap_create_gc (GdkDrawable     *drawable,
                       GdkGCValues     *values,
diff --git a/gdk/gdkpixmap.h b/gdk/gdkpixmap.h
index 863fa1b..e309038 100644
--- a/gdk/gdkpixmap.h
+++ b/gdk/gdkpixmap.h
@@ -54,9 +54,6 @@ struct _GdkPixmapObject
   GdkDrawable *impl;  /* window-system-specific delegate object */
 
   gint depth;
-  GdkWindow *backing_for;
-  int backing_x_offset;
-  int backing_y_offset;
 };
 
 struct _GdkPixmapObjectClass
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index 18a9b6d..a6a165f 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -902,9 +902,6 @@ gdk_event_translate (GdkDisplay *display,
   GdkToplevelX11 *toplevel = NULL;
   GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
   Window xwindow, filter_xwindow;
-  int exposure_x_offset = 0;
-  int exposure_y_offset = 0;
-  GdkWindow *unref_pixmap = NULL;
   
   return_val = FALSE;
 
@@ -932,31 +929,13 @@ gdk_event_translate (GdkDisplay *display,
    * are reported same as structure events
    */
   get_real_window (display, xevent, &xwindow, &filter_xwindow);
-
-  window = gdk_window_lookup_for_display (display, xwindow);
   
+  window = gdk_window_lookup_for_display (display, xwindow);
   /* We may receive events such as NoExpose/GraphicsExpose
    * and ShmCompletion for pixmaps
    */
   if (window && !GDK_IS_WINDOW (window))
-    {
-      GdkPixmapObject *pixmap = (GdkPixmapObject *)window;
-      if ((xevent->type == GraphicsExpose ||
-	   xevent->type == NoExpose) &&
-	  GDK_IS_PIXMAP (window) &&
-	  pixmap->backing_for != NULL)
-	{
-	  /* Unref the pixmap once for each finished set of GraphicsExposes */
-	  if (xevent->type == NoExpose ||
-	      xevent->xgraphicsexpose.count == 0)
-	    unref_pixmap = window;
-	  window = g_object_ref (pixmap->backing_for);
-	  exposure_x_offset = pixmap->backing_x_offset;
-	  exposure_y_offset = pixmap->backing_y_offset;
-	}
-      else
-	window = NULL;
-    }
+    window = NULL;
   window_private = (GdkWindowObject *) window;
 
   /* We always run the filters for the window where the event
@@ -1686,8 +1665,8 @@ gdk_event_translate (GdkDisplay *display,
             break;
           }
         
-	expose_rect.x = xevent->xgraphicsexpose.x + exposure_x_offset;
-	expose_rect.y = xevent->xgraphicsexpose.y + exposure_y_offset;
+	expose_rect.x = xevent->xgraphicsexpose.x;
+	expose_rect.y = xevent->xgraphicsexpose.y;
 	expose_rect.width = xevent->xgraphicsexpose.width;
 	expose_rect.height = xevent->xgraphicsexpose.height;
 	    
@@ -2228,9 +2207,6 @@ gdk_event_translate (GdkDisplay *display,
   
   if (window)
     g_object_unref (window);
-
-  if (unref_pixmap)
-    g_object_unref (unref_pixmap);
   
   return return_val;
 }



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