Commit fdbd5810 authored by Milan Crha's avatar Milan Crha
Browse files

Bug 782210 - Divide message list and preview panel size proportionally ][

parent 0da54395
......@@ -284,9 +284,6 @@ paned_size_allocate (GtkWidget *widget,
/* Chain up to parent's size_allocate() method. */
GTK_WIDGET_CLASS (e_paned_parent_class)->size_allocate (widget, allocation);
if (!paned->priv->toplevel_ready)
return;
if (paned->priv->sync_request == SYNC_REQUEST_PROPORTION &&
old_proportion != e_paned_get_proportion (paned) && old_proportion > 0.0) {
paned->priv->proportion = old_proportion;
......@@ -295,6 +292,9 @@ paned_size_allocate (GtkWidget *widget,
corrected_portion = TRUE;
}
if (!paned->priv->toplevel_ready)
return;
if (paned->priv->sync_request == SYNC_REQUEST_NONE) {
paned_recalc_positions (paned, FALSE);
return;
......@@ -330,7 +330,7 @@ paned_size_allocate (GtkWidget *widget,
"max-position", &max_position,
NULL);
clamp_position = position = MAX (0, CLAMP (position, min_position, max_position));
clamp_position = MAX (0, CLAMP (position, min_position, max_position));
if (clamp_position != gtk_paned_get_position (GTK_PANED (paned)))
gtk_paned_set_position (GTK_PANED (paned), clamp_position);
......
......@@ -660,6 +660,7 @@ e_shell_window_private_finalize (EShellWindow *shell_window)
g_hash_table_destroy (priv->loaded_views);
g_slist_free_full (priv->postponed_alerts, g_object_unref);
g_free (priv->geometry);
}
......
......@@ -98,6 +98,8 @@ struct _EShellWindowPrivate {
guint is_main_instance : 1;
gulong delayed_menubar_show_id;
GSList *postponed_alerts; /* EAlert * */
};
void e_shell_window_private_init (EShellWindow *shell_window);
......
......@@ -844,6 +844,14 @@ shell_window_submit_alert (EAlertSink *alert_sink,
GtkWidget *dialog;
shell_window = E_SHELL_WINDOW (alert_sink);
if (!gtk_widget_get_mapped (GTK_WIDGET (shell_window)) ||
shell_window->priv->postponed_alerts) {
shell_window->priv->postponed_alerts = g_slist_prepend (
shell_window->priv->postponed_alerts, g_object_ref (alert));
return;
}
alert_bar = e_shell_window_get_alert_bar (shell_window);
switch (e_alert_get_message_type (alert)) {
......@@ -863,6 +871,53 @@ shell_window_submit_alert (EAlertSink *alert_sink,
}
}
static gboolean
shell_window_submit_postponed_alerts_idle_cb (gpointer user_data)
{
EShellWindow *shell_window = user_data;
EAlertSink *alert_sink;
GSList *postponed_alerts, *link;
g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), FALSE);
postponed_alerts = g_slist_reverse (shell_window->priv->postponed_alerts);
shell_window->priv->postponed_alerts = NULL;
alert_sink = E_ALERT_SINK (shell_window);
for (link = postponed_alerts; link; link = g_slist_next (link)) {
EAlert *alert = link->data;
shell_window_submit_alert (alert_sink, alert);
}
g_slist_free_full (postponed_alerts, g_object_unref);
return FALSE;
}
static gboolean
shell_window_map_event (GtkWidget *widget,
GdkEventAny *event)
{
EShellWindow *shell_window;
gboolean res;
g_return_val_if_fail (E_IS_SHELL_WINDOW (widget), FALSE);
shell_window = E_SHELL_WINDOW (widget);
/* Chain up to parent's method */
res = GTK_WIDGET_CLASS (e_shell_window_parent_class)->map_event (widget, event);
g_idle_add_full (
G_PRIORITY_LOW,
shell_window_submit_postponed_alerts_idle_cb,
g_object_ref (shell_window), g_object_unref);
return res;
}
static void
e_shell_window_class_init (EShellWindowClass *class)
{
......@@ -881,6 +936,7 @@ e_shell_window_class_init (EShellWindowClass *class)
widget_class = GTK_WIDGET_CLASS (class);
widget_class->get_preferred_width = shell_window_get_preferred_width;
widget_class->map_event = shell_window_map_event;
class->close_alert = shell_window_close_alert;
class->construct_menubar = shell_window_construct_menubar;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment