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 672431 - the alt+tab app switch makes mnemonics flash
the alt+tab app switch makes mnemonics flash
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-03-20 04:04 UTC by William Jon McCann
Modified: 2012-09-01 02:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Add a delay before automatically showing mnemonics (3.44 KB, patch)
2012-08-20 23:49 UTC, Rui Matos
needs-work Details | Review
window: Add a delay before automatically showing mnemonics (3.88 KB, patch)
2012-08-28 13:41 UTC, Rui Matos
none Details | Review
window: Add a delay before automatically showing mnemonics (3.88 KB, patch)
2012-09-01 02:53 UTC, Matthias Clasen
committed Details | Review

Description William Jon McCann 2012-03-20 04:04:36 UTC
I use alt+tab a lot. And quite often the window I'm currently in has alt mnemonics "_" that show up right as I'm about to switch away from the app. It is really annoying and distracting. Not calming.
Comment 1 Rui Matos 2012-03-20 11:14:18 UTC
Yep, it does. Do you have suggestions about how it should behave?
Comment 2 William Jon McCann 2012-05-04 17:51:10 UTC
Perhaps only show the mnemonics after a small delay? The idea being that you are trying to discover something and aren't sure... hence pause for a second.
Comment 3 Rui Matos 2012-08-20 23:49:00 UTC
Created attachment 221942 [details] [review]
window: Add a delay before automatically showing mnemonics

Showing mnemonics immediately on modifier press can be annoying and
distracting when the user is just trying to Alt+Tab into another
application/window since the mnemonic will show up and quickly vanish
again when we receive the focus out event.

--

Here's a simple patch implementing the suggested behavior. Do we want
to make the delay configurable e.g. through GtkSettings?
Comment 4 William Jon McCann 2012-08-21 01:35:20 UTC
Bug 681876 is related
Comment 5 Matthias Clasen 2012-08-24 23:02:45 UTC
Review of attachment 221942 [details] [review]:

You need to remove the timeout in gtk_window_finalize too, I'd say.

::: gtk/gtkwindow.c
@@ +99,3 @@
  */
 
+#define AUTO_MNEMONICS_DELAY 500 /* ms */

This feels a little slow to me as the default.
250 or 300 is still more than enough to avoid Alt-Tab flicker.
You are probably right that it needs to be exposed as a setting.
I'd be tempted to tie it to the key-repeat delay on the settings-daemon side.

@@ +9786,3 @@
+
+  window->priv->auto_mnemonics_timeout_id =
+    g_timeout_add (AUTO_MNEMONICS_DELAY, set_auto_mnemonics_visible_cb, window);

Should use gdk_threads_add_timeout, as long as we still have the lock
Comment 6 Rui Matos 2012-08-28 13:41:19 UTC
Created attachment 222629 [details] [review]
window: Add a delay before automatically showing mnemonics

--

(In reply to comment #5)
> You need to remove the timeout in gtk_window_finalize too, I'd say.

Ups, fixed.

> ::: gtk/gtkwindow.c
> @@ +99,3 @@
>   */
>
> +#define AUTO_MNEMONICS_DELAY 500 /* ms */
>
> This feels a little slow to me as the default.
> 250 or 300 is still more than enough to avoid Alt-Tab flicker.

Changed to 300.

> You are probably right that it needs to be exposed as a setting.
> I'd be tempted to tie it to the key-repeat delay on the settings-daemon side.

Since a better fix is to probably have mnemonics disabled by default
as McCann says, let's just leave it hardcoded for now.

> @@ +9786,3 @@
> +
> +  window->priv->auto_mnemonics_timeout_id =
> +    g_timeout_add (AUTO_MNEMONICS_DELAY, set_auto_mnemonics_visible_cb,
> window);
>
> Should use gdk_threads_add_timeout, as long as we still have the lock

Sure.
Comment 7 Matthias Clasen 2012-09-01 02:53:16 UTC
The following fix has been pushed:
ed7a417 window: Add a delay before automatically showing mnemonics
Comment 8 Matthias Clasen 2012-09-01 02:53:19 UTC
Created attachment 223117 [details] [review]
window: Add a delay before automatically showing mnemonics

Showing mnemonics immediately on modifier press can be annoying and
distracting when the user is just trying to Alt+Tab into another
application/window since the mnemonic will show up and quickly vanish
again when we receive the focus out event.