[gtk+/client-side-windows] Implement gdk_window_clear_area natively for foreign windows



commit 0e548579de34dbbf8b74742d58a9a57ed69d658e
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Jun 26 15:45:53 2009 +0200

    Implement gdk_window_clear_area natively for foreign windows
    
    This fixes a redraw issue with the notification area in xfce4.

 gdk/gdkwindow.c         |   10 ++++++++++
 gdk/gdkwindowimpl.h     |    6 ++++++
 gdk/x11/gdkwindow-x11.c |   14 ++++++++++++++
 3 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 077a876..665e01f 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -4059,6 +4059,16 @@ gdk_window_clear_area_internal (GdkWindow *window,
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
+  if (GDK_WINDOW_DESTROYED (window))
+    return;
+
+  if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
+    {
+      GDK_WINDOW_IMPL_GET_IFACE (private->impl)->clear_area
+	(window, x, y, width, height, send_expose);
+      return;
+    }
+
   /* This is what XClearArea does, and e.g. GtkCList uses it,
      so we need to duplicate that */
   if (width == 0)
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index 5905de8..d12a872 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -71,6 +71,12 @@ struct _GdkWindowImplIface
                                          GdkWindow       *new_parent,
                                          gint             x,
                                          gint             y);
+  void         (* clear_area)           (GdkWindow       *window,
+                                         gint             x,
+                                         gint             y,
+					 gint             width,
+					 gint             height,
+					 gboolean         send_expose);
   
   void         (* set_cursor)           (GdkWindow       *window,
                                          GdkCursor       *cursor);
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 9caa17a..cd5a377 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1661,6 +1661,19 @@ gdk_window_x11_reparent (GdkWindow *window,
 }
 
 static void
+gdk_window_x11_clear_area (GdkWindow *window,
+			   gint       x,
+			   gint       y,
+			   gint       width,
+			   gint       height,
+			   gboolean   send_expose)
+{
+  XClearArea (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
+	      x, y, width, height,
+	      send_expose);
+}
+
+static void
 gdk_window_x11_raise (GdkWindow *window)
 {
   XRaiseWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
@@ -5556,6 +5569,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->set_background = gdk_window_x11_set_background;
   iface->set_back_pixmap = gdk_window_x11_set_back_pixmap;
   iface->reparent = gdk_window_x11_reparent;
+  iface->clear_area = gdk_window_x11_clear_area;
   iface->set_cursor = gdk_window_x11_set_cursor;
   iface->get_geometry = gdk_window_x11_get_geometry;
   iface->get_root_coords = gdk_window_x11_get_root_coords;



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