glade3 r1819 - in branches/gnome-2-22: . gladeui
- From: tvb svn gnome org
- To: svn-commits-list gnome org
- Subject: glade3 r1819 - in branches/gnome-2-22: . gladeui
- Date: Sun, 11 May 2008 18:13:41 +0100 (BST)
Author: tvb
Date: Sun May 11 17:13:41 2008
New Revision: 1819
URL: http://svn.gnome.org/viewvc/glade3?rev=1819&view=rev
Log:
* gladeui/glade-widget.c: Applied patch from Pavel Kostyuchenko to prevent
hangs in anjuta (bug 531585).
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/gladeui/glade-widget.c
Modified: branches/gnome-2-22/gladeui/glade-widget.c
==============================================================================
--- branches/gnome-2-22/gladeui/glade-widget.c (original)
+++ branches/gnome-2-22/gladeui/glade-widget.c Sun May 11 17:13:41 2008
@@ -2142,16 +2142,18 @@
glade_widget_debug_real (widget, 0);
}
-static gboolean
-glade_widget_show_idle (GladeWidget *widget)
+static void
+glade_widget_add_to_layout (GladeWidget *widget, GtkWidget *layout)
{
- /* This could be dangerous */
- if (GLADE_IS_WIDGET (widget))
- glade_widget_show (widget);
+ if (gtk_bin_get_child (GTK_BIN (layout)) != NULL)
+ gtk_container_remove (GTK_CONTAINER (layout), gtk_bin_get_child (GTK_BIN (layout)));
- return FALSE;
+ gtk_container_add (GTK_CONTAINER (layout), GTK_WIDGET (widget->object));
+
+ gtk_widget_show_all (GTK_WIDGET (widget->object));
}
+
/**
* glade_widget_show:
* @widget: A #GladeWidget
@@ -2165,29 +2167,22 @@
GtkWidget *layout;
g_return_if_fail (GLADE_IS_WIDGET (widget));
-
+
/* Position window at saved coordinates or in the center */
if (GTK_IS_WINDOW (widget->object) && glade_widget_embed (widget))
{
view = glade_design_view_get_from_project (glade_widget_get_project (widget));
layout = GTK_WIDGET (glade_design_view_get_layout (view));
- /* This case causes a black window */
- if (layout && !GTK_WIDGET_REALIZED (layout))
- {
- /* XXX Dangerous !!! give her a little kick */
- g_idle_add (glade_widget_show_idle, widget);
- return;
- }
- else if (!layout)
+ if (!layout)
return;
- if (gtk_bin_get_child (GTK_BIN (layout)) != NULL)
- gtk_container_remove (GTK_CONTAINER (layout), gtk_bin_get_child (GTK_BIN (layout)));
-
- gtk_container_add (GTK_CONTAINER (layout), GTK_WIDGET (widget->object));
-
- gtk_widget_show_all (GTK_WIDGET (widget->object));
+ if (GTK_WIDGET_REALIZED (layout))
+ glade_widget_add_to_layout (widget, layout);
+ else
+ g_signal_connect_data (G_OBJECT (layout), "map",
+ G_CALLBACK (glade_widget_add_to_layout),
+ widget, NULL, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
} else if (GTK_IS_WIDGET (widget->object))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]