diff options
author | Sébastien Granjoux <seb.sfo@free.fr> | 2013-06-18 22:45:10 +0200 |
---|---|---|
committer | Sébastien Granjoux <seb.sfo@free.fr> | 2013-06-26 21:52:06 +0200 |
commit | b81f5455d572bc18f1c121f1d45af9d0fd62b39e (patch) | |
tree | cd7472425ae843132b367a054fbb192facaecf6e | |
parent | a2ba7b937e585b59983d4b8e3a9793aca918d4a4 (diff) | |
download | glade-b81f5455d572bc18f1c121f1d45af9d0fd62b39e.tar.gz |
bgo #700730 - Weird windows showing up when a dock is moved while editing a GtkBuilder file
-rw-r--r-- | gladeui/glade-design-layout.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gladeui/glade-design-layout.c b/gladeui/glade-design-layout.c index 6b844843..bd239d8f 100644 --- a/gladeui/glade-design-layout.c +++ b/gladeui/glade-design-layout.c @@ -1602,6 +1602,7 @@ glade_design_layout_realize (GtkWidget * widget) { GladeDesignLayoutPrivate *priv; GdkWindowAttr attributes; + GtkWidget *child; gint attributes_mask, border_width; GtkAllocation allocation; GdkDisplay *display; @@ -1641,14 +1642,26 @@ glade_design_layout_realize (GtkWidget * widget) G_CALLBACK (pick_offscreen_child), widget); /* Offscreen window */ + child = gtk_bin_get_child (GTK_BIN (widget)); attributes.window_type = GDK_WINDOW_OFFSCREEN; attributes.x = attributes.y = 0; - attributes.width = attributes.height = 0; + + if (child && gtk_widget_get_visible (child)) + { + GtkAllocation alloc; + + gtk_widget_get_allocation (child, &alloc); + attributes.width = alloc.width; + attributes.height = alloc.height; + } + else + attributes.width = attributes.height = 0; priv->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (priv->offscreen_window, widget); - + + if (child) gtk_widget_set_parent_window (child, priv->offscreen_window); gdk_offscreen_window_set_embedder (priv->offscreen_window, priv->window); g_signal_connect (priv->offscreen_window, "to-embedder", |