[gtk+/gdk-backend: 29/91] Add a vfunc to replace _gdk_windowing_window_destroy_foreign
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend: 29/91] Add a vfunc to replace _gdk_windowing_window_destroy_foreign
- Date: Sat, 18 Dec 2010 01:08:15 +0000 (UTC)
commit 16832d9c993710e2a7bb9fbebb92adaaf9bc49a5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 10 14:06:13 2010 -0500
Add a vfunc to replace _gdk_windowing_window_destroy_foreign
All backends updated.
gdk/gdkwindow.c | 7 ++++++-
gdk/gdkwindowimpl.h | 18 ++++++++++--------
gdk/quartz/gdkwindow-quartz.c | 13 +++++++------
gdk/win32/gdkwindow-win32.c | 17 +++++++++--------
gdk/x11/gdkwindow-x11.c | 13 +++++++------
5 files changed, 39 insertions(+), 29 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 1f539e1..dc2f453 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1897,7 +1897,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;
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index f3dbda1..35aad92 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -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,
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 24b59d2..284ed8a 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -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;
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 0500cf1..bd00e2c 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -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;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 5c3b684..54c1791 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]