[evolution-patches] Fix for bug 255303 (Gal)



Hi,

I have attached the patch. It is a ugly hack to solve the problem. It
forces the view in the e-table and unfreezes it for the mouse buttons
from mailer. I dont know of a better fix :-(.

Please review the patch.

-Srini
Index: mail/em-folder-browser.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-browser.c,v
retrieving revision 1.71
diff -u -p -r1.71 em-folder-browser.c
--- mail/em-folder-browser.c	18 Dec 2005 08:24:25 -0000	1.71
+++ mail/em-folder-browser.c	10 Jan 2006 06:08:43 -0000
@@ -982,6 +982,16 @@ emfb_folder_changed(CamelFolder *folder,
 	mail_async_event_emit(emfb->view.async, MAIL_ASYNC_GUI, (MailAsyncFunc)emfb_gui_folder_changed, folder, NULL, emfb);
 }
 
+static void
+emfb_etree_unfreeze (GtkWidget *widget, GdkEvent *event, EMFolderView *emfv)
+{
+
+	ETableItem *item = e_tree_get_item (emfv->list->tree);
+
+	g_object_set_data (((GnomeCanvasItem *) item)->canvas, "freeze-cursor", 0);
+}
+
+
 /* TODO: This should probably be handled by message-list, by storing/queueing
    up the select operation if its busy rebuilding the message-list */
 static void
@@ -1023,6 +1033,8 @@ emfb_list_built (MessageList *ml, EMFold
 	 * e_canvas_item_region_show_relay() uses a timeout, we have to use a timeout of the
 	 * same interval but a lower priority. */
 	emfb->priv->idle_scroll_id = g_timeout_add_full (G_PRIORITY_LOW, 250, (GSourceFunc) scroll_idle_cb, emfb, NULL);
+	/* FIXME: This is another ugly hack done to hide a bug that above hack leaves. */
+	g_signal_connect (((GtkScrolledWindow *) ml)->vscrollbar, "button-press-event", G_CALLBACK (emfb_etree_unfreeze), emfb);
 }
 
 static void
Index: mail/message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.420
diff -u -p -r1.420 message-list.c
--- mail/message-list.c	17 Dec 2005 18:27:13 -0000	1.420
+++ mail/message-list.c	10 Jan 2006 06:08:55 -0000
@@ -1508,6 +1508,7 @@ message_list_setup_etree (MessageList *m
 		char *path;
 		char *name;
 		struct stat st;
+		ETableItem *item = e_tree_get_item (message_list->tree);
 
 		g_object_set (message_list->tree,
 			      "uniform_row_height", TRUE,
@@ -1517,6 +1518,8 @@ message_list_setup_etree (MessageList *m
 		d(printf ("folder name is '%s'\n", name));
 		
 		path = mail_config_folder_to_cachename (message_list->folder, "et-expanded-");
+		g_object_set_data (((GnomeCanvasItem *) item)->canvas, "freeze-cursor", 1);
+		
 		if (path && g_stat (path, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode)) {
 			/* build based on saved file */
 			e_tree_load_expanded_state (message_list->tree, path);
Index: widgets/table/e-table-item.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-item.c,v
retrieving revision 1.243
diff -u -p -r1.243 e-table-item.c
--- widgets/table/e-table-item.c	25 Aug 2005 06:54:58 -0000	1.243
+++ widgets/table/e-table-item.c	10 Jan 2006 06:09:01 -0000
@@ -1664,10 +1664,20 @@ static const char gray50_bits[] = {
 static void
 adjustment_changed (GtkAdjustment *adjustment, ETableItem *eti)
 {
+	/* FIXME: It is the ugliest of hack to set the focus to scroll. Fix this up when moving away from e-tree */
+	if (g_object_get_data ((GObject *) ((GnomeCanvasItem *) eti)->canvas, "freeze-cursor"))
+		eti_maybe_show_cursor (eti, 0);
+
 	eti_check_cursor_on_screen (eti);
 }
 
 static void
+eti_tree_unfreeze (GtkWidget *widget,  GdkEvent *event, ETableItem *eti)
+{
+	g_object_set_data (((GnomeCanvasItem *) eti)->canvas, "freeze-cursor", 0);
+}
+
+static void
 eti_realize (GnomeCanvasItem *item)
 {
 	ETableItem *eti = E_TABLE_ITEM (item);
@@ -1709,6 +1719,8 @@ eti_realize (GnomeCanvasItem *item)
 	eti->vadjustment_value_change_id =
 		g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "value_changed",
 				  G_CALLBACK (adjustment_changed), eti);
+
+	g_signal_connect (GTK_LAYOUT(item->canvas), "scroll_event", G_CALLBACK (eti_tree_unfreeze), eti);
 
 	if (eti->cell_views == NULL)
 		eti_attach_cell_views (eti);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]