Add a vfunc to replace _gdk_windowing_window_destroy_foreign

All backends updated.
This commit is contained in:
Matthias Clasen 2010-12-10 14:06:13 -05:00
parent 1e694b4dd8
commit 9a1cc81acb
5 changed files with 39 additions and 29 deletions

View File

@ -1934,7 +1934,12 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
* foreign windows in our hierarchy. * foreign windows in our hierarchy.
*/ */
if (window->parent) 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 /* Also for historical reasons, we remove any filters
* on a foreign window when it or a parent is destroyed; * on a foreign window when it or a parent is destroyed;

View File

@ -140,19 +140,21 @@ struct _GdkWindowImplClass
* *
* window: The window being destroyed * window: The window being destroyed
* recursing: If TRUE, then this is being called because a parent * recursing: If TRUE, then this is being called because a parent
* was destroyed. This generally means that the call to the windowing system * was destroyed. This generally means that the call to the windowing
* to destroy the window can be omitted, since it will be destroyed as a result * system to destroy the window can be omitted, since it will be
* of the parent being destroyed. Unless @foreign_destroy * 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 * foreign_destroy: If TRUE, the window or a parent was destroyed by some
* agency. The window has already been destroyed and no windowing * external agency. The window has already been destroyed and no
* system calls should be made. (This may never happen for some * windowing system calls should be made. (This may never happen
* windowing systems.) * for some windowing systems.)
*/ */
void (* destroy) (GdkWindow *window, void (* destroy) (GdkWindow *window,
gboolean recursing, gboolean recursing,
gboolean foreign_destroy); gboolean foreign_destroy);
void (*destroy_foreign) (GdkWindow *window);
cairo_surface_t * (* resize_cairo_surface) (GdkWindow *window, cairo_surface_t * (* resize_cairo_surface) (GdkWindow *window,
cairo_surface_t *surface, cairo_surface_t *surface,
gint width, gint width,

View File

@ -1060,9 +1060,9 @@ _gdk_windowing_window_init (void)
} }
static void static void
_gdk_quartz_window_destroy (GdkWindow *window, gdk_quartz_window_destroy (GdkWindow *window,
gboolean recursing, gboolean recursing,
gboolean foreign_destroy) gboolean foreign_destroy)
{ {
GdkWindowImplQuartz *impl; GdkWindowImplQuartz *impl;
GdkWindow *parent; GdkWindow *parent;
@ -1115,8 +1115,8 @@ gdk_window_quartz_resize_cairo_surface (GdkWindow *window,
return NULL; return NULL;
} }
void static void
_gdk_windowing_window_destroy_foreign (GdkWindow *window) gdk_quartz_window_destroy_foreign (GdkWindow *window)
{ {
/* Foreign windows aren't supported in OSX. */ /* 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->set_static_gravities = gdk_window_quartz_set_static_gravities;
impl_class->queue_antiexpose = _gdk_quartz_window_queue_antiexpose; impl_class->queue_antiexpose = _gdk_quartz_window_queue_antiexpose;
impl_class->translate = _gdk_quartz_window_translate; 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->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
impl_class->get_shape = gdk_quartz_window_get_shape; impl_class->get_shape = gdk_quartz_window_get_shape;
impl_class->get_input_shape = gdk_quartz_window_get_input_shape; impl_class->get_input_shape = gdk_quartz_window_get_input_shape;

View File

@ -685,10 +685,10 @@ gdk_window_foreign_new_for_display (GdkDisplay *display,
return window; return window;
} }
void static void
_gdk_win32_window_destroy (GdkWindow *window, gdk_win32_window_destroy (GdkWindow *window,
gboolean recursing, gboolean recursing,
gboolean foreign_destroy) gboolean foreign_destroy)
{ {
GdkWindowObject *private = (GdkWindowObject *)window; GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (private->impl); 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)); 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))); GDK_WINDOW_HWND (window)));
/* Remove ourself from the modal stack */ /* Remove ourself from the modal stack */
@ -744,8 +744,8 @@ gdk_win32_window_resize_cairo_surface (GdkWindow *window,
return NULL; return NULL;
} }
void static void
_gdk_windowing_window_destroy_foreign (GdkWindow *window) gdk_win32_window_destroy_foreign (GdkWindow *window)
{ {
/* It's somebody else's window, but in our hierarchy, so reparent it /* It's somebody else's window, but in our hierarchy, so reparent it
* to the desktop, and then try to destroy 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->set_static_gravities = gdk_win32_window_set_static_gravities;
iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose; iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose;
iface->translate = _gdk_win32_window_translate; 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->resize_cairo_surface = gdk_win32_window_resize_cairo_surface;
iface->get_shape = gdk_win32_window_get_shape; iface->get_shape = gdk_win32_window_get_shape;
iface->get_input_shape = gdk_win32_window_get_input_shape; iface->get_input_shape = gdk_win32_window_get_input_shape;

View File

@ -1001,9 +1001,9 @@ gdk_toplevel_x11_free_contents (GdkDisplay *display,
} }
static void static void
_gdk_x11_window_destroy (GdkWindow *window, gdk_x11_window_destroy (GdkWindow *window,
gboolean recursing, gboolean recursing,
gboolean foreign_destroy) gboolean foreign_destroy)
{ {
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkToplevelX11 *toplevel; GdkToplevelX11 *toplevel;
@ -1040,8 +1040,8 @@ gdk_window_x11_resize_cairo_surface (GdkWindow *window,
return surface; return surface;
} }
void static void
_gdk_windowing_window_destroy_foreign (GdkWindow *window) gdk_x11_window_destroy_foreign (GdkWindow *window)
{ {
/* It's somebody else's window, but in our hierarchy, /* It's somebody else's window, but in our hierarchy,
* so reparent it to the root window, and then send * 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->set_static_gravities = gdk_window_x11_set_static_gravities;
impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose; impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
impl_class->translate = _gdk_x11_window_translate; 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->resize_cairo_surface = gdk_window_x11_resize_cairo_surface;
impl_class->get_shape = gdk_x11_window_get_shape; impl_class->get_shape = gdk_x11_window_get_shape;
impl_class->get_input_shape = gdk_x11_window_get_input_shape; impl_class->get_input_shape = gdk_x11_window_get_input_shape;