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.
This commit is contained in:
Matthias Clasen 2009-11-27 23:44:01 -05:00
parent 2040547d96
commit 84254039f2

View File

@ -620,6 +620,23 @@ _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;
}