Blame SOURCES/evolution-3.28.5-deselect-task-memo-list.patch

2701e1
diff -up evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c.deselect-task-memo-list evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c
2701e1
--- evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c.deselect-task-memo-list	2018-07-30 15:37:05.000000000 +0200
2701e1
+++ evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c	2018-10-01 12:20:09.864492453 +0200
2701e1
@@ -296,6 +296,7 @@ typedef struct _OpenClientData {
2701e1
 	ECalBaseShellSidebar *sidebar;
2701e1
 	ESource *source;
2701e1
 	EClient *client;
2701e1
+	gboolean was_cancelled;
2701e1
 } OpenClientData;
2701e1
 
2701e1
 static void
2701e1
@@ -304,9 +305,14 @@ open_client_data_free (gpointer pdata)
2701e1
 	OpenClientData *data = pdata;
2701e1
 
2701e1
 	if (data) {
2701e1
+		/* To free the cancellable in the 'value' pair, which is useless now */
2701e1
+		g_hash_table_insert (data->sidebar->priv->selected_uids,
2701e1
+			g_strdup (e_source_get_uid (data->source)),
2701e1
+			NULL);
2701e1
+
2701e1
 		if (data->client) {
2701e1
 			g_signal_emit (data->sidebar, signals[CLIENT_OPENED], 0, data->client);
2701e1
-		} else {
2701e1
+		} else if (!data->was_cancelled) {
2701e1
 			ESourceSelector *selector = e_cal_base_shell_sidebar_get_selector (data->sidebar);
2701e1
 			e_source_selector_unselect_source (selector, data->source);
2701e1
 		}
2701e1
@@ -333,6 +339,7 @@ e_cal_base_shell_sidebar_open_client_thr
2701e1
 	selector = E_CLIENT_SELECTOR (e_cal_base_shell_sidebar_get_selector (data->sidebar));
2701e1
 	data->client = e_client_selector_get_client_sync (
2701e1
 		selector, data->source, TRUE, (guint32) -1, cancellable, &local_error);
2701e1
+	data->was_cancelled = g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
2701e1
 
2701e1
 	e_util_propagate_open_source_job_error (job_data, data->extension_name, local_error, error);
2701e1
 }
2701e1
@@ -350,6 +357,10 @@ e_cal_base_shell_sidebar_ensure_source_o
2701e1
 	g_return_if_fail (E_IS_CAL_BASE_SHELL_SIDEBAR (sidebar));
2701e1
 	g_return_if_fail (E_IS_SOURCE (source));
2701e1
 
2701e1
+	/* Skip it when it's already opening or opened */
2701e1
+	if (g_hash_table_contains (sidebar->priv->selected_uids, e_source_get_uid (source)))
2701e1
+		return;
2701e1
+
2701e1
 	shell_view = e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (sidebar));
2701e1
 
2701e1
 	switch (e_cal_base_shell_view_get_source_type (shell_view)) {