Closed Bug 425716 Opened 17 years ago Closed 17 years ago

Incorrect use of firstResponder in nsCocoaWindow.mm

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smichaud, Assigned: jaas)

References

Details

The sendEvent: method of the PopupWindow class in nsCocoaWindow.mm contains the following code ("self" is a PopupWindow object): // Target it at the first responder. if (!target) target = (NSView*)[self firstResponder]; But an NSWindow's firstResponder need not always be an NSView object (for example it could be the NSWindow object itself). So this code should be changed to something like: // Target it at the first responder. NSResponder *responder = [self firstResponder]; if (!target && [responder isKindOfClass:[NSView class]]) target = (NSView*)responder; I'm unaware of any specific problems caused by the incorrect code, so this bug isn't urgent. But this is an easy (and safe) change, and should probably be made fairly soon.
Flags: wanted1.9.0.x?
Steven, any work to fix this bug? Do you still believe it's wanted for 1.9.0.x?
My patch for this bug is now obsolete. The problem is fixed by my patch for bug 428405, which has been landed on mozilla-central, and is (hopefully) about to be landed on the 1.9.0 branch. There isn't any OBSOLETE tag ... so how should this bug be resolved?
Probably as a duplicate of bug 428405 since that's what fixed it? Or a dependency and simply resolve this bug as FIXED (by bug 428405).
Thanks for the suggestions. FIXED by patch for bug 428405.
Status: NEW → RESOLVED
Closed: 17 years ago
Depends on: 428405
Resolution: --- → FIXED
Flags: wanted1.9.0.x?
You need to log in before you can comment on or make changes to this bug.