Last Comment Bug 385966 - [10.5] Extra file menu appears to the right of the help menu (two file menus)
: [10.5] Extra file menu appears to the right of the help menu (two file menus)
Status: VERIFIED FIXED
[radar:5598550]
: relnote
Product: Core
Classification: Components
Component: Widget: Cocoa (show other bugs)
: Trunk
: x86 Mac OS X
: P1 normal with 2 votes (vote)
: ---
Assigned To: Josh Aas
:
Mentors:
: 369706 392279 399058 401397 401659 401853 402481 403142 403231 403309 403568 404471 404518 404662 404852 404891 404892 406925 (view as bug list)
Depends on: 403908 403967
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-26 14:43 PDT by Colin Barrett [:cbarrett]
Modified: 2007-12-31 09:29 PST (History)
46 users (show)
jaas: blocking1.9+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
test app v1.0 (26.75 KB, application/zip)
2007-11-13 14:51 PST, Josh Aas
no flags Details
fix v1.0 (3.52 KB, patch)
2007-11-13 22:00 PST, Josh Aas
mozcbarrett: review+
Details | Diff | Review
fix v1.1 (3.57 KB, patch)
2007-11-14 14:10 PST, Josh Aas
roc: superreview+
Details | Diff | Review

Description Colin Barrett [:cbarrett] 2007-06-26 14:43:55 PDT
STR:
1. Start Minefield.
2. Take focus from Minefield (click on The Finder)
3. Give focus to Minefield.

Expected Results:
9 Menus are shown, Minefield to Help.

Actual results:
10 menus are shown. To the right of Help is an extra File menu.

This only occurs on Mac OS X 10.5.
Comment 1 Josh Aas 2007-07-18 14:33:15 PDT
Marking this blocking, but hopefully it'll just get fixed by Apple in a newer 10.5 seed.
Comment 2 Smokey Ardisson (offline for a while; not following bugs - do not email) 2007-08-15 13:18:35 PDT
*** Bug 392279 has been marked as a duplicate of this bug. ***
Comment 3 Samuel Sidler (old account; do not CC) 2007-08-22 11:36:28 PDT
Josh, did you remove blocking1.9+ on the assumption that this will get fixed in a newer seed? I still see it in 9A500n using Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a8pre) Gecko/2007082204 Minefield/3.0a8pre

Are you sure enough that this is on Apple's end to make this not block 1.9?
Comment 4 Josh Aas 2007-08-22 12:17:07 PDT
I removed the 1.9+ because in a meeting today we decided that we won't be giving blocking1.9+ to any 10.5-only bugs. They should remain 1.9? for now until Apple's builds get further along and then we will re-evaluate.
Comment 5 Colin Barrett [:cbarrett] 2007-08-22 16:16:09 PDT
Filed as rdar://problem/5430656
Comment 6 Josh Aas 2007-08-27 10:04:44 PDT
This is still a problem with Leopard build 9a527.
Comment 7 Marcia Knous [:marcia - use ni] 2007-10-08 15:43:46 PDT
*** Bug 399058 has been marked as a duplicate of this bug. ***
Comment 8 Joël Kuiper 2007-10-12 14:09:26 PDT
The problem presists in 9A559
Comment 9 Reed Loden [:reed] (use needinfo?) 2007-10-27 14:33:08 PDT
*** Bug 401397 has been marked as a duplicate of this bug. ***
Comment 10 Al Billings [:abillings] 2007-10-27 14:44:48 PDT
This is still present in the final Leopard release.
Comment 11 Reed Loden [:reed] (use needinfo?) 2007-10-29 20:38:08 PDT
*** Bug 401659 has been marked as a duplicate of this bug. ***
Comment 12 Reed Loden [:reed] (use needinfo?) 2007-10-31 00:38:20 PDT
*** Bug 401853 has been marked as a duplicate of this bug. ***
Comment 13 Fred Wenzel [:wenzel] 2007-11-01 03:00:13 PDT
Confirming; problem persists in Leopard final (9A581).
Comment 14 Phil Ringnalda (:philor) 2007-11-04 16:17:35 PST
*** Bug 402481 has been marked as a duplicate of this bug. ***
Comment 15 Fred Wenzel [:wenzel] 2007-11-05 00:19:54 PST
Btw. the extra file menu is also not just a cosmetic issue: Clicking on it has a tendency to crash Minefield (for me, at least).
Comment 16 Patrick 2007-11-06 09:27:09 PST
(In reply to comment #15)
> Btw. the extra file menu is also not just a cosmetic issue: Clicking on it has
> a tendency to crash Minefield (for me, at least).
> 

Confirming, although it doesn't crash consistently. At times it only makes the menu excruciating slow, and some times it does nothing out of the ordinary. Have not discovered any particular steps to trigger each of those behaviors though.
Comment 17 Colin Barrett [:cbarrett] 2007-11-06 17:00:39 PST
Just an extra fun tidbit:

STR: With Minefield open, chose the Restart option from the Apple menu.
Expected results: Help menu is visible.
Actual results: Help menu *disappears*.

Whaaaa?
Comment 18 Kevin Brosnan 2007-11-07 06:48:01 PST
*** Bug 369706 has been marked as a duplicate of this bug. ***
Comment 19 Stephen Donner [:stephend] - PTO; back on 5/28 2007-11-08 21:10:26 PST
*** Bug 403142 has been marked as a duplicate of this bug. ***
Comment 20 Carsten Book [:Tomcat] 2007-11-09 11:44:27 PST
*** Bug 403231 has been marked as a duplicate of this bug. ***
Comment 21 Josh Aas 2007-11-09 15:08:34 PST
This is marked as P1 because it is commonly reported, confusing, and destabilizing. AppKit is getting into an essentially corrupted state.
Comment 22 Jesse Ruderman 2007-11-10 03:08:16 PST
*** Bug 403309 has been marked as a duplicate of this bug. ***
Comment 23 Nihar Shah 2007-11-11 16:27:18 PST
Still exists in build 2007111104 Minefield/3.0b2pre on Mac OS 10.5
Comment 24 Phil Ringnalda (:philor) 2007-11-12 19:30:53 PST
*** Bug 403568 has been marked as a duplicate of this bug. ***
Comment 25 Josh Aas 2007-11-13 14:51:30 PST
Created attachment 288560 [details]
test app v1.0

This test app demonstrates the OS bug. It does the same thing our app does, but in a reduced way. Much easier to play with than our actual menu code.
Comment 26 Josh Aas 2007-11-13 14:53:34 PST
You'll need Mac OS X 10.5 and Xcode 3 to build/run the test app.
Comment 27 Josh Aas 2007-11-13 16:29:19 PST
Filed Apple bug 5598550 on the issue, which includes the test app.
Comment 28 Josh Aas 2007-11-13 22:00:36 PST
Created attachment 288616 [details] [diff] [review]
fix v1.0

I found a way to handle menu bar swapping that doesn't trigger the AppKit bug. This works on 10.4 and 10.5.
Comment 29 Ben Turner (not reading bugmail, use the needinfo flag!) 2007-11-14 01:06:10 PST
Comment on attachment 288616 [details] [diff] [review]
fix v1.0

>+    if ([mainMenu numberOfItems] > 0)
>+      [[mainMenu itemAtIndex:0] setSubmenu:sApplicationMenu];
>+    else
>+      NS_WARNING("Main menu does not have any items, something is terribly wrong!");
>   }

Seems like that else could be dangerous in release builds without an #ifdef or scope braces.
Comment 30 Josh Aas 2007-11-14 01:15:09 PST
Even if the NS_WARNING resolves to nothing, the semicolon remains as an empty statement.
Comment 31 Ben Turner (not reading bugmail, use the needinfo flag!) 2007-11-14 11:08:09 PST
(In reply to comment #30)

Oh, of course. Sorry for the noise.
Comment 32 Colin Barrett [:cbarrett] 2007-11-14 13:36:13 PST
Comment on attachment 288616 [details] [diff] [review]
fix v1.0

>-    // an NSMenu can't have multiple supermenus, so when we paint a menu bar we unhook the
>-    // application menu from its current supermenu and hook it up to this menu bar's
>-    // application menu item. This way all changes to the application menu perist across
>-    // all instances of nsMenuBarX. We could assume 0 for indexOfItemWithSubmenu, but lets


>+  // Swap out first item into incoming menu bar.
>+  NSMenuItem* firstMenuItem = [[mainMenu itemAtIndex:0] retain];
>+  [mainMenu removeItemAtIndex:0];
>+  [mRootMenu insertItem:firstMenuItem atIndex:0];
>+  [firstMenuItem release];
>+

Bring back some of the comment you removed above, it's still relevant and explains why you're swapping the menu (I think).

r=me with that.
Comment 33 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2007-11-14 13:56:44 PST
+    else
+      NS_WARNING("Main menu does not have any items, something is terribly wrong!");

Why don't you make this an assert and the setSubmenu call above it unconditional?

+  if ([mainMenu numberOfItems] < 1) {
+    NS_WARNING("Main menu does not have any items, something is terribly wrong!");
+    return NS_ERROR_FAILURE;

Ditto.
Comment 34 Josh Aas 2007-11-14 14:10:30 PST
Created attachment 288741 [details] [diff] [review]
fix v1.1
Comment 35 Josh Aas 2007-11-14 22:28:46 PST
landed on trunk
Comment 36 Rob Campbell [:rc] (:robcee) 2007-11-15 07:28:33 PST
it's gone in today's nightly.
Comment 37 Stephen Donner [:stephend] - PTO; back on 5/28 2007-11-15 13:59:32 PST
Pretty sure this caused bug 403908.
Comment 38 Fred Wenzel [:wenzel] 2007-11-15 14:59:59 PST
Oh yeah, it reappeared when I just woke my laptop up from sleep (it was gone earlier today). Reopening.
Comment 39 :Gavin Sharp [email: gavin@gavinsharp.com] 2007-11-15 15:03:42 PST
(In reply to comment #38)
> Oh yeah, it reappeared when I just woke my laptop up from sleep (it was gone
> earlier today). Reopening.

That sounds like bug 403967.
Comment 40 Tony Chung [:tchung] 2007-11-16 15:39:05 PST
adding relnote keyword for b1
Comment 41 Jeremy Baron 2007-11-20 01:46:31 PST
*** Bug 404471 has been marked as a duplicate of this bug. ***
Comment 42 Dave Townsend [:mossop] 2007-11-20 06:19:11 PST
*** Bug 404518 has been marked as a duplicate of this bug. ***
Comment 43 Thomas Cloer 2007-11-20 09:21:29 PST
I'm still getting this one with 3.0b1 German on 10.5.1
Comment 44 Chris Blore 2007-11-20 09:24:18 PST
(In reply to comment #43)
> I'm still getting this one with 3.0b1 German on 10.5.1
> 

As far as I'm aware, this wasn't fixed until after the 3.0b1 cycle and therefore it is to be expected that you would see the bug.
Comment 45 Marcia Knous [:marcia - use ni] 2007-11-20 10:29:32 PST
Yes, you will still see the bug in the beta (en-US and locales), but it is not present in the current trunk nightlies.
Comment 46 Samuel Sidler (old account; do not CC) 2007-11-20 16:17:26 PST
*** Bug 404662 has been marked as a duplicate of this bug. ***
Comment 47 Carsten Book [:Tomcat] 2007-11-21 13:11:10 PST
*** Bug 404852 has been marked as a duplicate of this bug. ***
Comment 48 Carsten Book [:Tomcat] 2007-11-21 17:30:28 PST
*** Bug 404891 has been marked as a duplicate of this bug. ***
Comment 49 Brian Polidoro 2007-11-21 19:08:49 PST
*** Bug 404892 has been marked as a duplicate of this bug. ***
Comment 50 Larry Levine 2007-11-30 20:10:11 PST
For clarification - this bug has been fixed but is not part of the EN beta release?
Comment 51 Marcia Knous [:marcia - use ni] 2007-12-01 08:22:30 PST
Larry: Yes, that is correct.

(In reply to comment #50)
> For clarification - this bug has been fixed but is not part of the EN beta
> release?
> 

Comment 52 Stephen Donner [:stephend] - PTO; back on 5/28 2007-12-04 22:04:57 PST
*** Bug 406925 has been marked as a duplicate of this bug. ***
Comment 53 Carsten Book [:Tomcat] 2007-12-31 09:29:58 PST
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b3pre) Gecko/2007123104 Minefield/3.0b3pre
-> Verified fixed

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