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 738591 - Can't select file after showing header context menu
Can't select file after showing header context menu
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkGesture
3.14.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-10-15 20:11 UTC by Robert Roth
Modified: 2014-10-17 19:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkgesturesingle: Unset button/sequence if parent handle_event failed (1.23 KB, patch)
2014-10-17 19:20 UTC, Carlos Garnacho
committed Details | Review

Description Robert Roth 2014-10-15 20:11:10 UTC
Steps to reproduce:
1. open a filechooser (tried from glade, gedit, gtk3-widget-factory)
2. rightclick on the column headers (the context menu shows up)
3. click inside the file selector to dismiss the context menu and try to select a file
Expected: a file can be selected by clicking on a file and clicking Open or doubleclicking a file
What happens: files can not be selected, places can be switched, pathbar works, but regardless of the folder I am in, no file can be selected. The only thing I can do is dismiss the dialog with Esc (or Cancel).
Comment 1 Carlos Garnacho 2014-10-17 19:19:16 UTC
This is gestures fallout. It turned out to be an strange interaction between gtk_gesture_set_window() and GtkGestureSingle handle_event() implementation. 

1) gtk_gesture_set_window() would make handle_event() return FALSE (not being event_window==bin_window in this case), but still get the current button accounting in GtkGestureSingle triggered.
2) the menu triggers the grab, the gesture doesn't get the button release, but it was never nominally activated, so it's not reset either.
3) on subsequent presses, the previous "current button" (== 3) still applies, ditching the button press unless the button matched, so you could only ever trigger the context menu again
Comment 2 Carlos Garnacho 2014-10-17 19:19:55 UTC
The following fix has been pushed:
cfaec2d gtkgesturesingle: Unset button/sequence if parent handle_event failed
Comment 3 Carlos Garnacho 2014-10-17 19:20:00 UTC
Created attachment 288786 [details] [review]
gtkgesturesingle: Unset button/sequence if parent handle_event failed

There are legit reasons for GtkGesture::handle_event to return FALSE,
GtkGestureSingle objects should be unsetting the current button/sequence
if that happens, in order to avoid inconsistent states.