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 760891 - GtkTreeView Cannot expand/collapse rows by mouse
GtkTreeView Cannot expand/collapse rows by mouse
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2016-01-20 15:15 UTC by Maxim Reznik
Modified: 2016-01-27 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix (613 bytes, patch)
2016-01-20 15:15 UTC, Maxim Reznik
reviewed Details | Review
GtkTreeView: Update prelight row after revalidating rows (1.05 KB, patch)
2016-01-22 20:19 UTC, Carlos Garnacho
committed Details | Review

Description Maxim Reznik 2016-01-20 15:15:01 UTC
Created attachment 319442 [details] [review]
Patch to fix

Sometimes it is unable to expand/collapse rows by mouse until some mouse movement.

To reproduce:
1) Open gtk3-demo, expand a row (for example CSS Theming) and select it
2) Move mouse over the "arrow" on the next collapsed row (Entry). DON'T MOVE MOUSE SINCE THEN
3) Press keyboard shortcuts "-" then "+" to collapse "CSS Theming"
4) Now mouse click (without any move) won't expand "Entry" row.

If there is some movement of mouse - TreeView expands a row pointed by cursor.

I attach a patch to fix this. The idea is to update arrow_prelit flag on each mouse click before considering status of the flag.
Comment 1 Matthias Clasen 2016-01-21 13:02:27 UTC
Review of attachment 319442 [details] [review]:

looks good
Comment 2 Matthias Clasen 2016-01-21 20:15:27 UTC
Review of attachment 319442 [details] [review]:

Carlos has a different fix for this
Comment 3 Carlos Garnacho 2016-01-22 20:19:08 UTC
Yeah, seems better to do this after revalidating rows so the prelight row is updated ASAP, instead of late on motion/button press. I'm attaching/pushing the patch I did.
Comment 4 Carlos Garnacho 2016-01-22 20:19:30 UTC
Created attachment 319568 [details] [review]
GtkTreeView: Update prelight row after revalidating rows

It might have changed (eg. after a row being expanded, and the child
rows revalidated), so just update it here based on the last pointer
position.

Based on a patch by Maxim Reznik <reznikmm@gmail.com>
Comment 5 Carlos Garnacho 2016-01-22 20:20:31 UTC
Attachment 319568 [details] pushed as f32a54f - GtkTreeView: Update prelight row after revalidating rows
Comment 6 Maxim Reznik 2016-01-27 16:52:46 UTC
Thanks! I confirm that it works fine for me.