tree_view_button_press broken




the GtkTreeView widget has several bugs with regards to button press
handling. a simple patch to testtreeedit.c can help demonstrate this:

--- testtreeedit.c	12 May 2004 16:07:43 -0000	1.8
+++ testtreeedit.c	28 Jan 2005 22:38:50 -0000
@@ -154,6 +154,9 @@ main (gint argc, gchar **argv)
 				       NULL);
   g_signal_connect (renderer, "edited",
 		    G_CALLBACK (edited), tree_model);
+  g_signal_connect_swapped (renderer, "edited", g_print, "renderer: edited\n");
+  g_signal_connect_swapped (renderer, "editing_started", g_print, "renderer: editing_started\n");
+
   renderer = gtk_cell_renderer_text_new ();
   gtk_tree_view_column_pack_start (column, renderer, TRUE);
   gtk_tree_view_column_set_attributes (column, renderer,



the bugs i so far identified are:
1) reproduction:
   - fire up testtreeedit
   - double click on an editable field of a non-selected row
     (e.g. the first string in the second row)
   as a result, the row is selected, but editing is not started.
   performing the same action with two single clicks does popup
   a text editing field as expected.
   double clicking here shouldn't behave different from single
   clicks, i.e. editing should be started even on GDK_2BUTTON_PRESS.
   (this bug also extends to GDK_3BUTTON_PRESS)
2) immediate editing cancelation. the GDK_2BUTTON_PRESS event from
   bug (1) doesn't simply forget to enter editing mode, it does something
   worse: it starts and immediately cancels editing. this leads to
   "renderer: editing_started" being put out by the above patch. for
   other kinds of cell renderers however this can have much worse effects,
   such as popping up an extra editing window which may interact with
   immediate cancellation in various odd ways.
3) selecting an unselected row by clicking on an editable toggle/radio
   button changes its state. this is very counter intuitive, due to the
   different behaviour from other editable cells such as text fields and
   non-editable toggle cells.
   also, for some tree setups, row selection can become a very cumbersome
   task, if editable toggles occupy the larger part of a row.
   so row selection clicks should not alter a cells state.

the above bugs are present in gtk+-2.6.2 (CVS) and gtk+-2.4.14.

i have not filed bugs in bugzilla for these. i believe the GtkTreeView maintainers should do that themselves (and decide on whether/how to split
the bugs up into individual reports).

---
ciaoTJ



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