Closed Bug 1708032 Opened 4 years ago Closed 4 years ago

Remove MOZ_USE_NATIVE_POPUP_WINDOWS in nsCocoaWindow.mm

Categories

(Core :: Widget: Cocoa, defect, P2)

All
macOS
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: spohl, Assigned: spohl)

References

Details

Attachments

(1 file)

We should verify that what we're doing in nsCocoaWindow.mm is still correct with native context menus enabled. Replacing MOZ_USE_NATIVE_POPUP_WINDOWS with mozilla::widget::NativeMenuSupport::ShouldUseNativeContextMenus() does not work here because not all popups are context menus. However, we may or may not want to run this for native context menus. I haven't been able to wrap my mind around the implications of running or not running this for native context menus. Markus, maybe this is a straightforward thing for you to answer? I'm happy to put up a patch as we see fit.

Flags: needinfo?(mstange.moz)

That's some interesting code!

I think we should remove these two lines: https://searchfox.org/mozilla-central/rev/4648b6ee31c2519b1753023e4f4853b14fdd16e5/widget/cocoa/nsCocoaWindow.mm#340-341
They would make us create a zombie widget without a native window. This is not a good API. A widget should be a widget. If the caller doesn't want a widget, they shouldn't create one - i.e. this distinction should be handled at a higher level.

With today's incarnation native context menus, I'm actually not sure if we create an nsCocoaWindow for them. In any case, if we do, we never show it. And a widget that's never shown is harmless (other than maybe wasting some minimal CPU time).

Flags: needinfo?(mstange.moz)
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Pushed by spohl@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0af9f145068b Remove unused MOZ_USE_NATIVE_POPUP_WINDOWS from nsCocoaWindow.mm. r=mstange
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: