GNOME Bugzilla – Bug 673328
After clicking empty parts of a toolbar/menubar the next mouse click (button release) does not work
Last modified: 2012-04-05 08:17:47 UTC
After clicking on an empty part of a toolbar (to drag the window, for instance), clicking a button in the toolbar doesn't work. It looks/behaves as if the mouse button would not be released. You have to do a second click to actually click the button successfully. I see this behavior for instance with the toolbars of nautilus (path-bar), evolution and system settings. Happens with my up-to-date Fedora 17 with gtk3-3.4.0-1.fc17.x86_64
This bug is kind of dangerous in the case of nautilus, where, after clicking an empty part of the path-bar, the next click inside the current folder will behave as if you don't release the mouse button, so the user accidentally can move or mark folders with the rubber band.
Edit: also happens when clicking empty parts of a menubar! That explains the seemingly random selections I had seen in gnome-terminal for some time now.
I can confirm this; likely fallout from commit db2eb85e4af9d8f191fe1ade53ec85a94b326c9f Author: Rui Matos <tiagomatos@gmail.com> Date: Wed Feb 1 17:59:23 2012 +0000 x11: Cancel _NET_WM_MOVERESIZE if we get a matching ButtonRelease Rui, can you have a look ?
It seems that just moving the handle_wmspec_button_release call to the end of _gdk_x11_moveresize_handle_event is enough to make the problem go away.
Created attachment 211303 [details] [review] x11: Don't ignore button releases after a wmspec move/resize _gdk_x11_moveresize_configure_done() isn't called for wmspec moves/resizes so we don't have a way to notice when a wmspec move/resize ends and consequently untrigger the sending of _NET_WM_MOVERESIZE_CANCEL which results in this message always being sent on the next button release event. In that case we are marking that event as handled so it isn't processed further which breaks button press/release event handling in several widgets. To fix this we simply allow the normal event handling machinery to run after sending the _NET_WM_MOVERESIZE_CANCEL message. -- Yup, I misunderstood how _gdk_x11_moveresize_configure_done() was being called when I did that code. This patch should fix it.
Review of attachment 211303 [details] [review]: looks ok
Attachment 211303 [details] pushed as 7b0fd63 - x11: Don't ignore button releases after a wmspec move/resize