diff options
author | Matthias Clasen <mclasen@redhat.com> | 2009-11-27 23:44:01 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-11-30 22:38:20 -0500 |
commit | b1dfeb6fca92711297699215537ca1b25d80dff1 (patch) | |
tree | 38aafdd5ecaf9e7788b3323b292452e8c1bb681b /gtk | |
parent | 066c3c42dd01950ea56f5ed514e6ca14dd443cae (diff) | |
download | gdk-pixbuf-b1dfeb6fca92711297699215537ca1b25d80dff1.tar.gz |
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.
(cherry picked from commit 84254039f261b4c4421246ed4b90127711858af5)
Diffstat (limited to 'gtk')
-rw-r--r-- | 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 f6f3a3d48..5dbde457a 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: |