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 314298 - pointer grab lockup
pointer grab lockup
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.7.x
Other Linux
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 312465 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-23 19:09 UTC by Christian Persch
Modified: 2005-08-29 18:39 UTC
See Also:
GNOME target: 2.12.x
GNOME version: 2.11/2.12


Attachments
test-menus.c (1.02 KB, text/plain)
2005-08-29 09:04 UTC, Mark McLoughlin
  Details
gtk-menu-shell-hacky-dont-deactivate-when-not-active.patch (614 bytes, patch)
2005-08-29 09:06 UTC, Mark McLoughlin
needs-work Details | Review

Description Christian Persch 2005-08-23 19:09:56 UTC
Steps to reproduce (WARNING: you'll need to switch to console to kill
gnome-panel afterwards):
0) Open panel menu, navigate to a submenu with applications
1) Right-click over an item
2) Press ESC twice to dismiss the context menu and the menu
3) Left-click somewhere on a blank space on the panel

Actual results:
The panel grabs the pointer, and never again releases it. The user cannot
interact with any application with the mouse anymore!

gnome-panel 2.11.92, gnome-menus  2.11.92
Comment 1 Vincent Untz 2005-08-24 13:59:39 UTC
Doesn't happen on 2.10.x.
Comment 2 Raphael Slinckx 2005-08-24 14:21:49 UTC
I can reproduce it with same version as above
Comment 3 Frej Soya 2005-08-24 14:24:11 UTC
This also happens for me (untz, please ignore what i said on IRC).
version: 2.11.92

The pointer is changed in to drag mode after step 3.

You can get the pointer back by pressing ALT+F1, the panel is still in a bad
state since you only have to do step 3 to reproduce the bug. Panel works fine if
you don't click on a blank space though. 

Comment 4 Christian Persch 2005-08-25 15:28:10 UTC
The problem is with gnome-panel/menu.c: restore_grabs. It gets called when I
dismiss the context menu on the menu items, but then also when I afterwards just
click in the blank space on the panel.
Comment 5 Christian Persch 2005-08-25 15:28:57 UTC
Nominating as blocker for 2.12.0 because this is an extreme dataloss bug.
Comment 6 Luis Villa 2005-08-25 15:41:48 UTC
All pointer grabs (esp. if reproduceable) are showstoppers, so concurring.
Comment 7 Benjamin Berg 2005-08-25 15:43:57 UTC
*** Bug 312465 has been marked as a duplicate of this bug. ***
Comment 8 Mark McLoughlin 2005-08-29 09:01:37 UTC
This is down to a behavioural change in gtk+. Basically, in a few places the
panel relies on the fact that gtk+ would only emit a deactivate signal when a
menu is active - in recent gtk+ you can get a deactivate signal at other times too.

May need to fix this in the panel, but we'll see what the gtk+ guys say first.

In more detail, here's what's happening:

  - The context menu on the panel's applications menu has some code to restore
    the grabs on its parent menu when its deactivated. However, the context menu
    isn't destroyed when its deactivated. At some later stage when any other
    grab is added (e.g. left-clicking on the panel or searching the treeview in
    Add to Panel) we get another "deactivate" signal and try and restore the
    grabs to the menu again

  - Similarily, the context menu on the panel itself pushes an "autohide 
    disabler" when the menu is shown (this prevents the panel from autohiding
    while the menu is shown) and pops the disabler when the menu is deactivated.
    Again, the menu isn't destroyed and at some point later if we get notified
    of another grab we get another "deactivate" signal and assertions are
    spewed to stderr because we're trying to pop a non-existant disabler
Comment 9 Mark McLoughlin 2005-08-29 09:04:44 UTC
Created attachment 51504 [details]
test-menus.c

Silly test case that shows the "second deactivate" behaviour which wasn't
present in previous versions of gtk+

Just run it and hit Escape when the menu is shown
Comment 10 Mark McLoughlin 2005-08-29 09:06:06 UTC
Created attachment 51505 [details] [review]
gtk-menu-shell-hacky-dont-deactivate-when-not-active.patch

Equally silly patch which makes the problem go away (purely illustrative)
Comment 11 Mark McLoughlin 2005-08-29 18:39:57 UTC
This fixed it:

2005-08-29  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_grab_notify):  Only cancel if the menu
        was active.  (#314298, Christian Persch, analysis by Mark McLoughlin)