]> Pileus Git - ~andy/gtk/commitdiff
Add a vfunc to replace _gdk_windowing_window_destroy_foreign
authorMatthias Clasen <mclasen@redhat.com>
Fri, 10 Dec 2010 19:06:13 +0000 (14:06 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 21 Dec 2010 17:06:57 +0000 (12:06 -0500)
All backends updated.

gdk/gdkwindow.c
gdk/gdkwindowimpl.h
gdk/quartz/gdkwindow-quartz.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkwindow-x11.c

index 5d785e5db29b7841e14b575c42424003c70fe8b3..2e2a18c132674a42d1b12b417484abac98419d25 100644 (file)
@@ -1934,7 +1934,12 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
           * foreign windows in our hierarchy.
           */
          if (window->parent)
-           _gdk_windowing_window_destroy_foreign (window);
+            {
+              impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+
+              if (gdk_window_has_impl (window))
+                impl_class->destroy_foreign (window);
+            }
 
          /* Also for historical reasons, we remove any filters
           * on a foreign window when it or a parent is destroyed;
index f3dbda19f2aab91cf55eec9dbe50cab4c29eb4a2..35aad9231df27ca30da3a6896a020b23e8bbb63c 100644 (file)
@@ -140,19 +140,21 @@ struct _GdkWindowImplClass
  *
  * window: The window being destroyed
  * recursing: If TRUE, then this is being called because a parent
- *            was destroyed. This generally means that the call to the windowing system
- *            to destroy the window can be omitted, since it will be destroyed as a result
- *            of the parent being destroyed. Unless @foreign_destroy
- *            
- * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
- *            agency. The window has already been destroyed and no windowing
- *            system calls should be made. (This may never happen for some
- *            windowing systems.)
+ *     was destroyed. This generally means that the call to the windowing
+ *     system to destroy the window can be omitted, since it will be
+ *     destroyed as a result of the parent being destroyed.
+ *     Unless @foreign_destroy
+ * foreign_destroy: If TRUE, the window or a parent was destroyed by some
+ *     external agency. The window has already been destroyed and no
+ *     windowing system calls should be made. (This may never happen
+ *     for some windowing systems.)
  */
   void         (* destroy)              (GdkWindow       *window,
                                         gboolean         recursing,
                                         gboolean         foreign_destroy);
 
+  void         (*destroy_foreign)       (GdkWindow       *window);
+
   cairo_surface_t * (* resize_cairo_surface) (GdkWindow       *window,
                                               cairo_surface_t *surface,
                                               gint             width,
index 24b59d23b171f6086975e92ae5a0a4ae1ff6ac38..284ed8a76d0df95fb095dccf058bced13940d543 100644 (file)
@@ -1060,9 +1060,9 @@ _gdk_windowing_window_init (void)
 }
 
 static void
-_gdk_quartz_window_destroy (GdkWindow *window,
-                            gboolean   recursing,
-                            gboolean   foreign_destroy)
+gdk_quartz_window_destroy (GdkWindow *window,
+                           gboolean   recursing,
+                           gboolean   foreign_destroy)
 {
   GdkWindowImplQuartz *impl;
   GdkWindow *parent;
@@ -1115,8 +1115,8 @@ gdk_window_quartz_resize_cairo_surface (GdkWindow       *window,
   return NULL;
 }
 
-void
-_gdk_windowing_window_destroy_foreign (GdkWindow *window)
+static void
+gdk_quartz_window_destroy_foreign (GdkWindow *window)
 {
   /* Foreign windows aren't supported in OSX. */
 }
@@ -2959,7 +2959,8 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
   impl_class->set_static_gravities = gdk_window_quartz_set_static_gravities;
   impl_class->queue_antiexpose = _gdk_quartz_window_queue_antiexpose;
   impl_class->translate = _gdk_quartz_window_translate;
-  impl_class->destroy = _gdk_quartz_window_destroy;
+  impl_class->destroy = gdk_quartz_window_destroy;
+  impl_class->destroy_foreign = gdk_quartz_window_destroy_foreign;
   impl_class->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
   impl_class->get_shape = gdk_quartz_window_get_shape;
   impl_class->get_input_shape = gdk_quartz_window_get_input_shape;
index 0500cf1582df99e9a6f459867ef6c9739a5adf62..bd00e2c4d940405c98d628d604434ae3f1304dcd 100644 (file)
@@ -685,10 +685,10 @@ gdk_window_foreign_new_for_display (GdkDisplay      *display,
   return window;
 }
 
-void
-_gdk_win32_window_destroy (GdkWindow *window,
-                          gboolean   recursing,
-                          gboolean   foreign_destroy)
+static void
+gdk_win32_window_destroy (GdkWindow *window,
+                         gboolean   recursing,
+                         gboolean   foreign_destroy)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
@@ -696,7 +696,7 @@ _gdk_win32_window_destroy (GdkWindow *window,
 
   g_return_if_fail (GDK_IS_WINDOW (window));
   
-  GDK_NOTE (MISC, g_print ("_gdk_win32_window_destroy: %p\n",
+  GDK_NOTE (MISC, g_print ("gdk_win32_window_destroy: %p\n",
                           GDK_WINDOW_HWND (window)));
 
   /* Remove ourself from the modal stack */
@@ -744,8 +744,8 @@ gdk_win32_window_resize_cairo_surface (GdkWindow       *window,
   return NULL;
 }
 
-void
-_gdk_windowing_window_destroy_foreign (GdkWindow *window)
+static void
+gdk_win32_window_destroy_foreign (GdkWindow *window)
 {
   /* It's somebody else's window, but in our hierarchy, so reparent it
    * to the desktop, and then try to destroy it.
@@ -3284,7 +3284,8 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->set_static_gravities = gdk_win32_window_set_static_gravities;
   iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose;
   iface->translate = _gdk_win32_window_translate;
-  iface->destroy = _gdk_win32_window_destroy;
+  iface->destroy = gdk_win32_window_destroy;
+  iface->destroy_foreign = gdk_win32_window_destroy_foreign;
   iface->resize_cairo_surface = gdk_win32_window_resize_cairo_surface;
   iface->get_shape = gdk_win32_window_get_shape;
   iface->get_input_shape = gdk_win32_window_get_input_shape;
index 5c3b6849dd70fd9e94de01d8854c0410ff3a5e9e..54c1791adbd4b42cdcb836731f94b6ea3c1e7fad 100644 (file)
@@ -1001,9 +1001,9 @@ gdk_toplevel_x11_free_contents (GdkDisplay *display,
 }
 
 static void
-_gdk_x11_window_destroy (GdkWindow *window,
-                        gboolean   recursing,
-                        gboolean   foreign_destroy)
+gdk_x11_window_destroy (GdkWindow *window,
+                        gboolean   recursing,
+                        gboolean   foreign_destroy)
 {
   GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
   GdkToplevelX11 *toplevel;
@@ -1040,8 +1040,8 @@ gdk_window_x11_resize_cairo_surface (GdkWindow       *window,
   return surface;
 }
 
-void
-_gdk_windowing_window_destroy_foreign (GdkWindow *window)
+static void
+gdk_x11_window_destroy_foreign (GdkWindow *window)
 {
   /* It's somebody else's window, but in our hierarchy,
    * so reparent it to the root window, and then send
@@ -4999,7 +4999,8 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
   impl_class->set_static_gravities = gdk_window_x11_set_static_gravities;
   impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
   impl_class->translate = _gdk_x11_window_translate;
-  impl_class->destroy = _gdk_x11_window_destroy;
+  impl_class->destroy = gdk_x11_window_destroy;
+  impl_class->destroy_foreign = gdk_x11_window_destroy_foreign;
   impl_class->resize_cairo_surface = gdk_window_x11_resize_cairo_surface;
   impl_class->get_shape = gdk_x11_window_get_shape;
   impl_class->get_input_shape = gdk_x11_window_get_input_shape;