Bug#301610: Acknowledgement (libgtk2.0-0: The number of selected rows is incorrect in "cursor-changed" callback.)

Igor Belyi Igor Belyi <belyi@users.sourceforge.net>, 301610@bugs.debian.org
Sun, 27 Mar 2005 18:14:58 -0500


This is a multi-part message in MIME format.
--------------030607070506020703080609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Interestingly enough, the following small patch fixes the problem. I'm 
not very much familiar with gtk+2.0 internals to know if there's some 
other side effects of this change. I'd appreciate if somebody can check it.

Cheers,
Igor



--------------030607070506020703080609
Content-Type: text/x-patch;
 name="gtktreeview-cursor_changed.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="gtktreeview-cursor_changed.patch"

--- gtk+-2.6.2/gtk/gtktreeview.c.orig	2005-03-27 16:25:48.000000000 -0500
+++ gtk+-2.6.2/gtk/gtktreeview.c	2005-03-27 16:26:08.000000000 -0500
@@ -2370,13 +2370,13 @@
 
           if (event->state & GDK_CONTROL_MASK)
             {
-              gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
               gtk_tree_view_real_toggle_cursor_row (tree_view);
+              gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
             }
           else if (event->state & GDK_SHIFT_MASK)
             {
-              gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
               gtk_tree_view_real_select_cursor_row (tree_view, FALSE);
+              gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
             }
           else
             {

--------------030607070506020703080609--