aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-paned.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/widgets/misc/e-paned.c b/widgets/misc/e-paned.c
index 08eef6f076..b363d0aa0e 100644
--- a/widgets/misc/e-paned.c
+++ b/widgets/misc/e-paned.c
@@ -156,6 +156,8 @@ paned_realize (GtkWidget *widget)
{
EPanedPrivate *priv;
GtkWidget *toplevel;
+ GdkWindowState state;
+ GdkWindow *window;
priv = E_PANED_GET_PRIVATE (widget);
@@ -167,10 +169,18 @@ paned_realize (GtkWidget *widget)
* to make that happen. */
toplevel = gtk_widget_get_toplevel (widget);
-
- priv->wse_handler_id = g_signal_connect_swapped (
- toplevel, "window-state-event",
- G_CALLBACK (paned_window_state_event_cb), widget);
+ window = gtk_widget_get_window (toplevel);
+ state = gdk_window_get_state (window);
+
+ /* If the window is withdrawn, wait for it to be shown before
+ * setting the pane position. If the window is already shown,
+ * it's safe to set the pane position immediately. */
+ if (state & GDK_WINDOW_STATE_WITHDRAWN)
+ priv->wse_handler_id = g_signal_connect_swapped (
+ toplevel, "window-state-event",
+ G_CALLBACK (paned_window_state_event_cb), widget);
+ else
+ priv->toplevel_ready = TRUE;
}
static void