After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 136496 - setting fixed_height_mode property breaks gtk_tree_model_row_changed() and related.
setting fixed_height_mode property breaks gtk_tree_model_row_changed() and re...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.4.x
Other Linux
: High normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2004-03-07 22:31 UTC by Pawel Salek
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtktreedemo2.c (14.34 KB, text/plain)
2004-03-07 22:32 UTC, Pawel Salek
  Details
Fixed height patch (1.62 KB, patch)
2004-07-06 14:04 UTC, Jonathan Blandford
none Details | Review
Proposed fix (451 bytes, patch)
2004-08-12 20:24 UTC, Pawel Salek
none Details | Review
Improved testcase (14.45 KB, text/plain)
2004-08-13 06:09 UTC, Pawel Salek
  Details
Testcase for fixed_height_mode TreeView update problem. (1.30 KB, text/plain)
2004-08-26 20:11 UTC, Dave Cook
  Details

Description Pawel Salek 2004-03-07 22:31:41 UTC
When "fixed_height_mode" property (which is very useful, BTW) is set,
gtk_tree_model_row_changed() does not update the view any more.

A short program demonstrating the problem is attached to the report.
Compiling it with cc `pkg-config --cflags --libs gtk+-2.0` gtktreedemo2.c
will generate program that does not set fixed_height_mode and flips a cell
every 0.5 seconds. Compiling it with -DBUG option enables fixed_height_mode
but the program does not automatically update the modified cell any more.
Comment 1 Pawel Salek 2004-03-07 22:32:26 UTC
Created attachment 25303 [details]
gtktreedemo2.c
Comment 2 Elijah Newren 2004-06-19 18:45:27 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.
Comment 3 Jonathan Blandford 2004-07-06 14:04:13 UTC
Here's a proposed fix.  I haven't tried to compile it yet, but it should be right.
Comment 4 Jonathan Blandford 2004-07-06 14:04:48 UTC
Created attachment 29280 [details] [review]
Fixed height patch
Comment 5 Matthias Clasen 2004-07-06 14:32:43 UTC
Fix doesn't compile, but otherwise works fine :-)
Comment 6 Pawel Salek 2004-08-11 20:05:56 UTC
Checked out 2.4.4: It seems that the coordinates of the invalidated rectangle
are computed incorrectly: the problem still appears under certain conditions but
replacing gtk_widget_queue_draw_area() with gtk_widget_queue_draw() make them
disappear.
Comment 7 Pawel Salek 2004-08-12 20:24:38 UTC
Created attachment 30483 [details] [review]
Proposed fix

Found it: y was computed in widget coordinates instead of window coordinates.
Attached patch is to be applied against current CVS. I am not entirely
convinced about TREE_VIEW_HEADER_HEIGHT() part but that is what the rest of the
code does as far as I can tell.
Comment 8 Matthias Clasen 2004-08-13 04:25:41 UTC
I can't see any problems with your testcase above and the current code. Can you 
give a testcase demonstrating the remaining problems ?
Comment 9 Pawel Salek 2004-08-13 06:09:19 UTC
Created attachment 30506 [details]
Improved testcase

The bug is simply demonstrated by flipping the bottom cell instead the top cell
so that vadjustment->offset can be non-zero). Compile attached modification of
the previous test with same options and scroll down to the bottom.
Comment 10 Matthias Clasen 2004-08-13 20:53:07 UTC
Works fine for me... I see the last line being updated.
Comment 11 Pawel Salek 2004-08-14 06:15:46 UTC
Matthias: Is it the test case works fine for you? Have you compiled the test
case *with* -DBUG to enable fixed-height mode? Have you *scrolled* down so that
 vadjustment->offset is non-zero? Which version of GTK2 have you tested with?
Have you looked at the definition of gtk_tree_view_get_visible_rect(),
gtk_tree_view_adjustment_changed(),  gtk_tree_view_tree_to_widget_coords() (the
latter two suggest that we could alternatively use tree_view->priv->dy because
the adjustment is set to this value).

Please be more specific.
Comment 12 Matthias Clasen 2004-08-14 13:10:51 UTC
The testcase fails to demonstrate the alleged problem for me on an unpatched gtk
HEAD - I haven't tesed 2.4.x yet though
Comment 13 Pawel Salek 2004-08-14 17:44:07 UTC
I have reproduced the problem with current CVS HEAD gtk by compiling the
improved test case (id=30506) with cc `pkg-config --cflags --libs gtk+-2.0`
-DBUG gtktreedemo2a.c and scrolling down without resizing the window. I have got
also a confirmation that the problem  is present in a following configuration:

* Gnome 2.6.1, with gtk+ and glib upgraded to

$ pkg-config --modversion gtk+-2.0 glib-2.0
  2.4.4
  2.4.5

* PowerMac running YellowDog Linux 3.01:
  kernel 2.4.25, gcc 3.2.2, glibc 2.3.1
Comment 14 Matthias Clasen 2004-08-24 01:53:33 UTC
Ok, I missed the -DBUG part. Can reproduce it now.
Comment 15 Matthias Clasen 2004-08-24 14:27:20 UTC
                        
                        
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_node_queue_redraw): Take header
	height and adjustment into account.  (#136496, Pawek Salek)
Comment 16 Dave Cook 2004-08-26 20:11:24 UTC
Created attachment 30991 [details]
Testcase for fixed_height_mode TreeView update problem.

I'm still having trouble with the view updating in 2.4.9.  I'll attach
a simple test case with 2 views, one with fixed-height-mode FALSE and the other
TRUE (it's in Python; sorry, my C is very rusty).  Just enter some text into
the entry and click the button.  The fixed-height-mode view won't update until
you wave your mouse over the cell.
Comment 17 Dave Cook 2004-08-28 01:43:59 UTC
Ah, you have to set_fix_width as well as set_sizing to TREEVIEW_COLUMN_FIXED. 
Then the update works.

        viewcol.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
        viewcol.set_fixed_width(200);