GNOME Bugzilla – Bug 738591
Can't select file after showing header context menu
Last modified: 2014-10-17 19:20:00 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).
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
The following fix has been pushed: cfaec2d gtkgesturesingle: Unset button/sequence if parent handle_event failed
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.