Last Comment Bug 525762 - Alt+Tab sometimes causes the menubar to unhide briefly
: Alt+Tab sometimes causes the menubar to unhide briefly
Status: VERIFIED FIXED
calm-ui
: regression, verified1.9.2
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: Trunk
: x86 Windows XP
: -- trivial (vote)
: mozilla1.9.3a4
Assigned To: neil@parkwaycc.co.uk
:
: Jim Mathies [:jimm]
Mentors:
Depends on:
Blocks: 272847
  Show dependency treegraph
 
Reported: 2009-11-01 11:30 PST by Dão Gottwald [:dao]
Modified: 2010-04-14 10:50 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
.4-fixed
.10-fixed


Attachments
patch (2.44 KB, patch)
2009-11-01 11:41 PST, Dão Gottwald [:dao]
no flags Details | Diff | Splinter Review
patch v2 (2.50 KB, patch)
2009-11-01 11:46 PST, Dão Gottwald [:dao]
no flags Details | Diff | Splinter Review
patch v2 (2.41 KB, patch)
2010-01-31 06:55 PST, Dão Gottwald [:dao]
no flags Details | Diff | Splinter Review
Proposed patch (657 bytes, patch)
2010-03-24 13:46 PDT, neil@parkwaycc.co.uk
jmathies: review+
mbeltzner: approval1.9.2.4+
mbeltzner: approval1.9.1.10+
Details | Diff | Splinter Review

Description Dão Gottwald [:dao] 2009-11-01 11:30:36 PST

    
Comment 1 Dão Gottwald [:dao] 2009-11-01 11:41:54 PST
Created attachment 409613 [details] [diff] [review]
patch
Comment 2 Dão Gottwald [:dao] 2009-11-01 11:46:34 PST
Created attachment 409614 [details] [diff] [review]
patch v2

Err, of course I shouldn't use Cc and Ci here.
Comment 3 Dão Gottwald [:dao] 2010-01-31 06:55:59 PST
Created attachment 424480 [details] [diff] [review]
patch v2

updated to tip
Comment 4 neil@parkwaycc.co.uk 2010-02-21 09:54:10 PST
Sorry, but I just haven't been able to reproduce this, either by Alt+Tabbing to another application or to another window in the same Gecko application.
Comment 5 Dão Gottwald [:dao] 2010-02-21 10:11:22 PST
Can you still review the code? Considering the menubar active in an inactive window doesn't make sense either way.

It happens for me every second try, approximately. But as I said, it's probably system dependent.
Comment 6 Neil Deakin 2010-03-15 11:48:36 PDT
Comment on attachment 424480 [details] [diff] [review]
patch v2

>+      <property name="_isWinActive" readonly="true">
>+        <getter><![CDATA[
>+          var fm = Components.classes["@mozilla.org/focus-manager;1"]
>+                             .getService(Components.interfaces.nsIFocusManager);
>+          return window == fm.activeWindow;

Should we be concerned that this will only work if the <menubar> is in the toplevel window?


>+      <handler event="DOMMenuBarActive"><![CDATA[
>+        // It's possible that we're getting DOMMenuBarActive even if the window
>+        // isn't active anymore because of Alt+Tab.

Isn't that a bug in itself?

I don't see the bug though. DOMMenuBarActive should be sent on keyup, so the menu shouldn't be triggered then. Maybe some locale keyboard difference?
Comment 7 Dão Gottwald [:dao] 2010-03-15 12:23:40 PDT
(In reply to comment #6)
> (From update of attachment 424480 [details] [diff] [review])
> >+      <property name="_isWinActive" readonly="true">
> >+        <getter><![CDATA[
> >+          var fm = Components.classes["@mozilla.org/focus-manager;1"]
> >+                             .getService(Components.interfaces.nsIFocusManager);
> >+          return window == fm.activeWindow;
> 
> Should we be concerned that this will only work if the <menubar> is in the
> toplevel window?

I don't think so... auto-hiding doesn't make sense for other menubars, since Alt wouldn't activate them.

> >+      <handler event="DOMMenuBarActive"><![CDATA[
> >+        // It's possible that we're getting DOMMenuBarActive even if the window
> >+        // isn't active anymore because of Alt+Tab.
> 
> Isn't that a bug in itself?
> 
> I don't see the bug though. DOMMenuBarActive should be sent on keyup, so the
> menu shouldn't be triggered then. Maybe some locale keyboard difference?

I think it's because the event is async and the netbook I'm running Win XP on is rather slow...
Comment 8 Neil Deakin 2010-03-18 13:20:14 PDT
> > I don't see the bug though. DOMMenuBarActive should be sent on keyup, so the
> > menu shouldn't be triggered then. Maybe some locale keyboard difference?
> 
> I think it's because the event is async and the netbook I'm running Win XP on
> is rather slow...

DOMMenuBarActive shouldn't be firing at all.

Can you debug here a bit a find out what menu/popups related events and key events are actually firing when?
Comment 9 Dão Gottwald [:dao] 2010-03-21 10:12:11 PDT
When releasing Alt+Tab quickly, regardless of whether the menu bar shows up, I get these events:

keydown, keyup, deactivate, DOMMenuBarActive, DOMMenuItemActive, DOMMenuBarInactive, DOMMenuItemInactive

If I release Tab and wait a bit before releasing Alt, the menu bar never shows up and I get these events:

keydown, keyup, keyup, deactivate
Comment 10 neil@parkwaycc.co.uk 2010-03-24 13:43:29 PDT
This is actually a regression of bug 262894 by bug 272847.
Comment 11 neil@parkwaycc.co.uk 2010-03-24 13:46:12 PDT
Created attachment 434643 [details] [diff] [review]
Proposed patch
Comment 12 Jim Mathies [:jimm] 2010-03-24 14:32:57 PDT
Comment on attachment 434643 [details] [diff] [review]
Proposed patch

oops!
Comment 13 neil@parkwaycc.co.uk 2010-03-26 01:34:36 PDT
Pushed changeset 91897531cbf5 to mozilla-central.
Comment 14 neil@parkwaycc.co.uk 2010-03-26 01:37:07 PDT
Comment on attachment 434643 [details] [diff] [review]
Proposed patch

Seeking approval for this simple fix for the branches where the regression typo landed.
Comment 15 Dão Gottwald [:dao] 2010-03-26 06:09:11 PDT
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a4pre) Gecko/20100326 Minefield/3.7a4pre

Works like a charm.
Comment 16 Mike Beltzner [:beltzner, not reading bugmail] 2010-03-29 10:55:22 PDT
Comment on attachment 434643 [details] [diff] [review]
Proposed patch

a=beltzner for 1.9.1.10 and 1.9.2.3
Comment 17 neil@parkwaycc.co.uk 2010-03-29 16:21:14 PDT
Pushed changeset 499f6d27d231 to releases/mozilla-1.9.2

Pushed changeset 0865dc62ccad to releases/mozilla-1.9.1
Comment 18 Al Billings [:abillings] 2010-04-12 12:45:51 PDT
Dão can you verify this with the nightly 1.9.2 and 1.9.1 builds since you can reproduce the problem easily?
Comment 19 Dão Gottwald [:dao] 2010-04-13 23:45:10 PDT
Verified with Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.9.2.4pre) Gecko/20100413 Namoroka/3.6.4pre
Comment 20 Dão Gottwald [:dao] 2010-04-13 23:53:29 PDT
Cannot verify on 1.9.1, as the menu bar doesn't support auto-hiding there.
Comment 21 Al Billings [:abillings] 2010-04-14 10:50:23 PDT
Thanks!

Note You need to log in before you can comment on or make changes to this bug.