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 612611 - auto-mnemonics breaks menu scrolling
auto-mnemonics breaks menu scrolling
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-03-11 18:04 UTC by Cody Russell
Modified: 2010-10-31 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix menu scrolling and auto-mnemonics issue. (62 bytes, patch)
2010-07-21 15:02 UTC, Ayan George
none Details | Review
Patch for menu-scrolling and auto-mnemonics issue. (565 bytes, patch)
2010-07-21 15:07 UTC, Ayan George
none Details | Review
patch (2.46 KB, patch)
2010-10-19 12:41 UTC, Matthias Clasen
none Details | Review

Description Cody Russell 2010-03-11 18:04:27 UTC
Turning on auto-mnemonics appears to break menu scrolling.  Try running tests/testmenus and open up the dynamic menu (unless you have a really tall monitor, this will grow the menu enough that you should be able to key down the menu).
Comment 1 Cody Russell 2010-03-24 15:32:00 UTC
This is fixed in 2.20.
Comment 2 Ayan George 2010-07-21 15:01:13 UTC
We also need to make sure keyboard_mode is disabled when a mouse enters the menu_shell.  Otherwise, I see strange behavior for menus that scroll.
Comment 3 Ayan George 2010-07-21 15:02:24 UTC
Created attachment 166290 [details] [review]
Patch to fix menu scrolling and auto-mnemonics issue.
Comment 4 Ayan George 2010-07-21 15:04:15 UTC
Comment on attachment 166290 [details] [review]
Patch to fix menu scrolling and auto-mnemonics issue.

index c3e107f..f3aca36 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -885,6 +885,11 @@ gtk_menu_shell_enter_notify (GtkWidget        *widget,
 {
   GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
 
+       /* If we've received a mouse enter event, it is safe to assume
+        * we are no longer in keyboard mode.
+        */
+       menu_shell->keyboard_mode = FALSE;
+
   if (event->mode == GDK_CROSSING_GTK_GRAB ||
       event->mode == GDK_CROSSING_GTK_UNGRAB ||
       event->mode == GDK_CROSSING_STATE_CHANGED)
Comment 5 Ayan George 2010-07-21 15:07:23 UTC
Created attachment 166291 [details] [review]
Patch for menu-scrolling and auto-mnemonics issue.


Sorry -- please ignore the last attachment and comment. :(

I'm having a long day.

This is a proper patch for the menu-scrolling and auto-mnemonics issue I've been seeing.
Comment 6 Cody Russell 2010-07-23 10:40:40 UTC
Looks reasonable to me.
Comment 7 Cody Russell 2010-08-05 15:50:55 UTC
Re-opening for now.  Matthias, does Ayan's patch look okay to you?
Comment 8 Matthias Clasen 2010-08-05 16:07:10 UTC
The way keyboard mode is designed is that it gets turned on on the first keynav, and then stays on until the entire menu hierarchy gets dismissed.

The patch breaks that, so no, it doesn't look immediately ok. I think we need to track down the 'strange behaviour' instead.
Comment 9 Matthias Clasen 2010-10-15 03:23:14 UTC
Can you describe the 'strange behaviour' in some more detail ?
Comment 10 ayan.george 2010-10-15 13:30:14 UTC
To reproduce the behavior, you need to be using a theme that has auto-mnemonics turned on and a menu that is so tall that it scrolls.

First open the menu by navigating to it with the mouse, then scroll to the last entry with the keyboard (the easiest way is to press the up arrow).

Now, once you move the mouse back into  the menu, it will gtk_menu_scroll_to() to the 0th position.

This makes it impossible to select, for example, the last entry in the menu with the mouse since the menu repositions itself when the mouse enters the menu shell.

I hope that makes sense.
Comment 11 Matthias Clasen 2010-10-18 14:32:31 UTC
I don't think this problem is related to keyboard_mode at all. At least I can reproduce jumpy scrolling on mouse-enter with or without your change applied.
Comment 12 Matthias Clasen 2010-10-19 12:40:17 UTC
This turns out to be caused by appearing and disappearing mnemonics causing size changes of menu items, which in turn causes us to call gtk_menu_reposition on the attached submenu, which looses the scroll_offset information.

Here is a not quite correct patch which fixes the problem.
Comment 13 Matthias Clasen 2010-10-19 12:41:20 UTC
Created attachment 172708 [details] [review]
patch