[gtk+] Handle reparenting out of a socket
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Handle reparenting out of a socket
- Date: Sat, 28 Nov 2009 04:51:06 +0000 (UTC)
commit 84254039f261b4c4421246ed4b90127711858af5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Nov 27 23:44:01 2009 -0500
Handle reparenting out of a socket
Although it isnt' allowed by the XEMBED protocol, its possible
that the plug window will be reparented out of the socket without
the socket having done so. See bug 123569. Patch by David Jander.
gtk/gtksocket-x11.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index f6f3a3d..5dbde45 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -620,7 +620,24 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
return_val = GDK_FILTER_REMOVE;
}
-
+ else
+ {
+ if (socket->plug_window && xre->window == GDK_WINDOW_XWINDOW (socket->plug_window) && xre->parent != GDK_WINDOW_XWINDOW (widget->window))
+ {
+ gboolean result;
+
+ _gtk_socket_end_embedding (socket);
+
+ g_object_ref (widget);
+ g_signal_emit_by_name (widget, "plug-removed", &result);
+ if (!result)
+ gtk_widget_destroy (widget);
+ g_object_unref (widget);
+
+ return_val = GDK_FILTER_REMOVE;
+ }
+ }
+
break;
}
case UnmapNotify:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]