If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

initial menu item enabled state often incorrect

RESOLVED FIXED

Status

()

Core
Widget: Cocoa
RESOLVED FIXED
12 years ago
11 years ago

People

(Reporter: Josh Aas, Assigned: Josh Aas)

Tracking

Trunk
PowerPC
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

6.88 KB, patch
Mark Mentovai
: review+
Mike Pinkerton (not reading bugmail)
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

12 years ago
1. Open Cocoa Firefox
2. Close initial window with mouse
3. Hit command-w

Since no windows are open at this point, command-w should be disabled. However, it does not get disabled until you show the menu on screen. If for step 3 you try to use the mouse you won't have this problem because the menu is shown on the screen.

We should definitely fix menu updating, and maybe also not crash even if the bad command does get sent.
Note this was always an issue in Carbon widget, AFAICT the command isn't fired.

Comment 2

11 years ago
Every time you open a menu, all items are recreated, so it may be due to the fact that the command handlers do not point at the right items then?

(BTW, DOM inspector on mac seems to be broken where the fundamental problem is in the way we tear down menus as soon as you turn your back on them; I debugged this a few months ago.)
(Assignee)

Updated

11 years ago
No longer blocks: 326469
(Assignee)

Updated

11 years ago
Summary: menus not updated unless shown, can cause crashes → initial menu item enabled state often incorrect
(Assignee)

Comment 3

11 years ago
Created attachment 225754 [details] [diff] [review]
fix v1.0

When a menu item is initially created, its enabled state is pulled from its own DOM node, which is inaccurate until the state changes for the first time or the menu item is updated via the OnCreate handler. Since enabled state matters even when menus are not open, we should dig it out from the command content instead of the DOM node content when the nsMenuItem object is created.
Attachment #225754 - Flags: review?(mark)

Comment 4

11 years ago
Comment on attachment 225754 [details] [diff] [review]
fix v1.0

Excellent!
Attachment #225754 - Flags: review?(mark) → review+
(Assignee)

Updated

11 years ago
Attachment #225754 - Flags: superreview?(mikepinkerton)
Comment on attachment 225754 [details] [diff] [review]
fix v1.0

sr=pink
Attachment #225754 - Flags: superreview?(mikepinkerton) → superreview+
(Assignee)

Comment 6

11 years ago
fixed on trunk
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.