Граф коммитов

4101 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 3a54b24c9b Bug 1872997 - [cocoa] Don't trigger mouseenter/leave events for windows that ignore mouse events. r=mac-reviewers,mstange
In the patches above, we make some tooltips (which ignore mouse events)
actually overlap the mouse. That should be fine (and is fine on other
platforms) but Cocoa still sends mouseenter/leave events which confuse
the front-end.

This fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D197905
2024-01-10 22:51:28 +00:00
Sam Johnson d1dacbb26c Bug 1871514 - Improve macOS control colors. r=mac-reviewers,emilio
Instead of NSColor.textColor, use NSColor.controlTextColor, which is the color observed in native controls.

When these values were originally selected in bug 517412, the system colors were the same, but they have since diverged.

Differential Revision: https://phabricator.services.mozilla.com/D197125
2024-01-10 22:22:52 +00:00
Natalia Csoregi b7ba987ae4 Backed out changeset 51d87c2129d2 (bug 1865372) for causing RunWatchdog crashes in test_fullscreen_modal.html. CLOSED TREE 2024-01-09 01:41:58 +02:00
Emilio Cobos Álvarez 59b776ccd4 Bug 1872997 - Remove "fit to screen" code in cocoa widget. r=mac-reviewers,bradwerth
No other platform does this. This comes from bug 413277, but positioning
windows (in particular popups) partially offscreen is desirable in some
cases (e.g., when drawing non-native shadows).

We have protections in place to prevent content from doing things like
what caused this code to be added.

Remove a cocoa-specific test for this, and tweak another test which has
a dependent window opened from an offscreen window, and the offscreen
window positioning happens right after the load event.

The window ends up on screen even without that tweak.

Differential Revision: https://phabricator.services.mozilla.com/D197903
2024-01-08 19:46:13 +00:00
Iulian Moraru 4f13b132e2 Backed out changeset 11bda0f9d0fc (bug 1872997) for causing mochitest-chrome failures on test_bug413277.html. CLOSED TREE 2024-01-08 21:33:33 +02:00
Emilio Cobos Álvarez 96d98fbb70 Bug 1872997 - Remove "fit to screen" code in cocoa widget. r=mac-reviewers,bradwerth
No other platform does this. This comes from bug 413277, but positioning
windows (in particular popups) partially offscreen is desirable in some
cases (e.g., when drawing non-native shadows).

We have protections in place to prevent content from doing things like
what caused this code to be added.

Differential Revision: https://phabricator.services.mozilla.com/D197903
2024-01-08 18:15:20 +00:00
Brad Werth f11bb5ff7a Bug 1865372: Call nsCocoaWindow::DestroyNativeWindow unconditionally in Destroy. r=mac-reviewers,mstange
This seems like the right time to call DestroyNativeWindow since we are
hiding the window and destorying the nsBaseWidget -- there's not much
else that can happen to this window. Making this call here ensures that
the native window is not maintained on the screen waiting for the
destructor to be called during garbage collection.

Differential Revision: https://phabricator.services.mozilla.com/D197214
2024-01-08 17:47:58 +00:00
Emilio Cobos Álvarez ec1ddfebcd Bug 1872983 - Restore behavior of -moz-window-shadow: auto and appearance: none. r=dholbert
Before the first part of bug 1872399, that would use
WindowShadow::Default, which didn't create a vibrant effect etc, which
causes the background here.

Make it more explicit by calling this "Panel". The second part of
bug 1872399 already did this.

Differential Revision: https://phabricator.services.mozilla.com/D197648
2024-01-04 23:47:54 +00:00
Jon Parise 3b5280be4f Bug 1872505 - Use NSString in InsertText* paths. r=m_kato
The InsertText* code paths required an NSAttributedString instance but
only ever used their NSString representation. Callers nearly always have
an NSString, so this results in a lot of unnecessary NSAttributedString
allocations to satisfy this interface.

The primary caller is [ChildView insertText:replacementRange:], which
can receive either an NSString or an NSAttributedString string from the
NSTextInputClient protocol, but this is usually (always?) an NSString in
practice.

We can instead change these methods to receive NSString, simplifying the
callers and removing a bunch of short-lived NSAttributedString objects.

Differential Revision: https://phabricator.services.mozilla.com/D197451
2024-01-02 08:37:26 +00:00
Emilio Cobos Álvarez 35c465dca0 Bug 1872399 - Clean-up -moz-window-shadow set-up. r=dholbert
-moz-window-shadow is a chrome-only property (not exposed to the web),
and chrome stylesheets only use the none value to disable the default
behavior.

Split the style property (default/none) from the actual widget behavior.
This is useful because I want to add a distinction between
natively-styled menupopups and other panels in the following commit.

While at it rename default to "auto" which is a more common name in CSS
for something like this.

We have no use case for removing the shadow of a top-level window, so
remove it to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D197454
2023-12-31 21:53:32 +00:00
Sam Johnson 593c49fa81 Bug 1872325 - Reduce macOS menupopup border radius. r=emilio,desktop-theme-reviewers
The macOS menupopup corner radius was recently changed from 4px to 8px, but that does not quite match the system, which measures at 6px.

Differential Revision: https://phabricator.services.mozilla.com/D197408
2023-12-29 05:46:33 +00:00
Emilio Cobos Álvarez bab2e723d2 Bug 1871030 - Improve how macOS non-native menupopups look. r=desktop-theme-reviewers,mac-reviewers,dao,bradwerth
Give them the same radius as on Linux, which matches the OS more closely.

Differential Revision: https://phabricator.services.mozilla.com/D196960
2023-12-26 11:24:55 +00:00
Sam Johnson 9e320eb3bc Bug 1871507 - Native-looking tooltips for macOS. r=desktop-theme-reviewers,emilio
Native tooltips, menus, and other opaque windows on macOS receive a border from the window server, which greatly improves their appearance with dark mode. Borderless windows, such as popups, do not receive this treatment by default. However, we have been receiving this treatment for non-native menupopups by setting an effect view wrapper as the window's content view. Extending this logic to also support tooltips allows the window server to provide the appropriate border for them as well.

macOS also provides some additional padding to native tooltips, so I have updated this as well.

Differential Revision: https://phabricator.services.mozilla.com/D197122
2023-12-26 10:24:18 +00:00
Stephen A Pohl f666401558 Bug 1870924: Prevent crashes when trying to access the menu bar in headless mode. r=mac-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D197212
2023-12-23 06:52:28 +00:00
Sandor Molnar 7e131cc523 Backed out changeset d95b94d4f547 (bug 1871514) for causing wpt failures at /css/css-color/deprecated-sameas CLOSED TREE 2023-12-23 05:04:26 +02:00
Sam Johnson 9ee10ec03e Bug 1871514 - Improve macOS control colors. r=mac-reviewers,bradwerth
Instead of NSColor.textColor, use NSColor.controlTextColor, which is the color observed in native controls.

When these values were originally selected in bug 517412, the system colors were the same, but they have since diverged.

Differential Revision: https://phabricator.services.mozilla.com/D197125
2023-12-22 20:30:57 +00:00
Emilio Cobos Álvarez 084cffcd52 Bug 1870481 - Restore unified toolbar window looks. r=mac-reviewers,desktop-theme-reviewers,dao,spohl
By using a opaque-appearance widget (which is effectively what
appearance: -moz-dialog used to provide).

There's the question of whether we want the current vibrant titlebars,
but this restores the behavior precisely for now.

Differential Revision: https://phabricator.services.mozilla.com/D196712
2023-12-18 16:19:36 +00:00
Gijs Kruitbosch c6f003d117 Bug 1858409 - only show autofill/services menus when appropriate, r=mac-reviewers,reusable-components-reviewers,mstange,emilio,tgiles
Differential Revision: https://phabricator.services.mozilla.com/D196296
2023-12-14 08:27:56 +00:00
Vsevolod Buzinov 0b3eb819d6 Bug 1869853 - Reversed window transparency logic r=emilio
One-liner to fix the accidental omission of the "not" sign in window
transparency logic.

Differential Revision: https://phabricator.services.mozilla.com/D196329
2023-12-13 21:02:59 +00:00
Emilio Cobos Álvarez b21a492ac7 Bug 1869299 - Generalize -moz-mac-sidebar into a cross-platform -moz-sidebar{,text,border} set. r=dao,desktop-theme-reviewers,win-reviewers,gstoll
This will be useful for Adwaita. Keep the field colors in this patch
tho.

Differential Revision: https://phabricator.services.mozilla.com/D196150
2023-12-12 15:22:44 +00:00
Emilio Cobos Álvarez 4d0e714795 Bug 1866022 - Teach GTK to render non-native tree columns and toolbars. r=dao,stransky,desktop-theme-reviewers
This fixes various things, like sort arrows not working, even in regular
non-mixed-color-scheme settings, and is a lot less code.

The toolbarbutton appearance on the problematic case described in
comment 0 could get some work (the extra borders aren't exactly pretty),
but it's still a much better improvement.

Differential Revision: https://phabricator.services.mozilla.com/D195345
2023-12-04 18:57:35 +00:00
Sylvestre Ledru ef35fa7374 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
clang-format version 17.0.6 (taskcluster-QueHFUviQeyM8Y7r_d7MQQ)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D195397
2023-12-04 10:09:36 +00:00
Stanca Serban 09ce7deff1 Backed out changeset 343359fed17c (bug 1824171) for causing multiple failures. CLOSED TREE 2023-12-03 16:01:58 +02:00
Emilio Cobos Álvarez 9ba76cd6ad Bug 1867659 - Always honor transparent window requests. r=mac-reviewers,bradwerth
This allows removing the weird PiP special-case recently introduced.

After bug 1867854 the side effects it caused (transparent profile
manager etc) are no longer a concern.

This makes macOS widget behavior more similar to Windows and Linux.

Depends on D195297

Differential Revision: https://phabricator.services.mozilla.com/D195298
2023-12-03 10:53:09 +00:00
Emilio Cobos Álvarez 028152d350 Bug 1824171 - Make macOS window flags consistent and remove PiP special-case. r=mac-reviewers,pip-reviewers,mconley,bradwerth
The window style mask docs don't seem to mention the restriction our
code mentioned.

Make the flags consistent with Gecko's to simplify the code and remove the
PiP special-case.

Depends on D195296

Differential Revision: https://phabricator.services.mozilla.com/D195297
2023-12-03 10:52:45 +00:00
Emilio Cobos Álvarez d31360a906 Bug 1867854 - Remove appearance: dialog. r=desktop-theme-reviewers,dao
This is not really needed.

It was never needed if you used background-color: transparent, which is what
the browser did to get sidebar vibrancy, fwiw.

Instead of applying transparency globally, opt-into it explicitly for
things that need it (the unified toolbar of the page info / library windows).

I checked the other things that were using it (wizard and updates.css)
and I don't see any rendering change with this change (tried showing the
update history from about:support, and the create profile wizard).

Depends on D195294

Differential Revision: https://phabricator.services.mozilla.com/D195295
2023-12-03 10:49:37 +00:00
Emilio Cobos Álvarez e7fc2b380a Bug 1867854 - Improve background color for library window sidebar. r=desktop-theme-reviewers,dao
In bug 1861954 I also removed the vibrancy of the places window.

Unlike the browser sidebar this one didn't have an explicit background
color. Add back a system color for the mac sidebar and use it in both
places. This matches the old -moz-mac-source-list color.

Differential Revision: https://phabricator.services.mozilla.com/D195294
2023-12-03 10:43:14 +00:00
Jonathan Watt 2323f848cd Bug 1867646. Stop using the deprecated [NSColor colorUsingColorSpaceName]. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D195162
2023-11-30 21:36:16 +00:00
Vsevolod Buzinov 637c5339ea Bug 1865494: Implement see-through video player mode r=emilio,mstange,desktop-theme-reviewers,pip-reviewers,mhowell
Implement experimental transparent-on-hover behavior for the
picture-in-picture video player. This makes the popup player less of
a nuisance on smaller displays.

Tested on macOS, but should also work on Windows with small tweaks.

The behavior is hidden behind a pref:
media.videocontrols.picture-in-picture.seethrough-mode.enabled

Differential Revision: https://phabricator.services.mozilla.com/D193993
2023-11-30 18:33:41 +00:00
Iulian Moraru d84469b005 Backed out changeset 4bbe309179a5 (bug 1866098) for causing bc failures related to browser_startup. CLOSED TREE 2023-11-30 06:32:21 +02:00
Eitan Isaacson 903ed5e54e Bug 1866098 - Allow processing native events before [NSApp run]. r=nika
Thunderbird has a primary password modal show up before the app starts. It uses a raw event loop.
This needs to be changed to be after NSApp::run so it will be accessible, but that will be for a future fix.

Also, we need to do NSApp::stop: in applicationDidFinishLaunching asynchronously when processing URLs.
For some reason we end up in a bad state if we process events before NSApp::run and then call stop within
applicationDidFinishLaunching. The AppKit assertion says "NSApp with wrong _running count" even though we do not do
nested calls to NSApp::run.

Differential Revision: https://phabricator.services.mozilla.com/D194951
2023-11-29 21:34:14 +00:00
Stephen A Pohl 877adfeec8 Bug 1478347: Ensure that macOS-provided menu items are available in the Edit menu, especially in multi-language environments where Firefox may have a different language than the OS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D193931
2023-11-28 03:11:40 +00:00
Stephen A Pohl 50e66f5102 Bug 1699936: Prevent possible crashes due to Objective-C exceptions when drawing the menubar on macOS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D143845
2023-11-27 15:25:11 +00:00
Stephen A Pohl 08cf4945a8 Bug 1765391: Add more exception handling to help isolate when the OS is throwing an NSGenericException when painting menu bars on macOS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D193794
2023-11-27 15:25:11 +00:00
Jonathan Watt 50f811aef5 Bug 1865485. Rename nsIPrintSettings::HasOrthogonalSheetsAndPages to HasOrthogonalPagesPerSheet. r=dholbert
The old name is potentially misleading now that we implement 'page-orientation'
since that provides a new mechanism by which pages could end up orthoganal
to the sheet, but this method is very specifically about pages-per-sheet
induced rotation.

Differential Revision: https://phabricator.services.mozilla.com/D193989
2023-11-20 09:14:50 +00:00
Emilio Cobos Álvarez 21fde94e5c Bug 1863426 - Roll up tooltips too in nsCocoaWindow's RollupPopups. r=mac-reviewers,spohl
This matches what we do on other platforms too.

Differential Revision: https://phabricator.services.mozilla.com/D193786
2023-11-16 11:28:12 +00:00
Stephen A Pohl f569cd0575 Bug 1808223: Work around a bug in macOS that causes hidden menu items to be added every time a user switches between windows, ultimately causing significant slowdowns when switching between windows. Based on a patch by David Levy. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D193415
2023-11-15 18:53:05 +00:00
Emilio Cobos Álvarez ff5ed156f0 Bug 1863691 - Use non-deprecated system colors for menus on macOS. r=mac-reviewers,spohl
Also remove some no-longer-used or hard-coded system colors.

Differential Revision: https://phabricator.services.mozilla.com/D193059
2023-11-15 09:52:37 +00:00
Norisz Fay 3d631ca250 Backed out changeset 4432ccd2193c (bug 1808223) as requested by developer CLOSED TREE 2023-11-13 22:59:41 +02:00
Stephen A Pohl aa86602269 Bug 1808223: Work around a bug in macOS that causes menu items to be added every time a user switches between windows, ultimately causing significant slowdowns when switching between windows. Based on a patch by David Levy. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D193415
2023-11-13 18:49:28 +00:00
Andrew McCreight a3fd771d1d Bug 1859643 - Remove nsSoundProxy. r=spohl,win-reviewers
nsISound is no longer used in content processes.

Differential Revision: https://phabricator.services.mozilla.com/D192115
2023-11-06 16:27:07 +00:00
Edgar Chen 9529ca9444 Bug 1862956 - Use `FlavorsTransferableCanExport` to get the available flavor list from cached transferable; r=nika,spohl
Differential Revision: https://phabricator.services.mozilla.com/D192678
2023-11-03 16:50:11 +00:00
Emilio Cobos Álvarez 40c5cc4d11 Bug 1861954 - Remove vibrancy on the osx sidebar. r=desktop-theme-reviewers,dao
This accidentally broke in 119 and nobody noticed on the whole nightly +
beta cycle (other than due to bug 1861669).

Given sidebars are not super-commonly used these days, this makes the
code a bit less fragile, and it still looks pretty good IMO. Also, since
we want to get rid of <xul:tree>s, this is one less thing to worry
about.

Depends on D192102

Differential Revision: https://phabricator.services.mozilla.com/D192103
2023-11-01 09:05:51 +00:00
Emilio Cobos Álvarez 5e6062194f Bug 1861671 - Remove some dead macOS menu drawing code. r=mac-reviewers,bradwerth
Some of it was already dead like the arrow-button-{up,down} stuff.

Depends on D192082

Differential Revision: https://phabricator.services.mozilla.com/D192083
2023-10-31 18:57:12 +00:00
ran1 41141c9402 Bug 1837824 - Nightly fails to start in macOS Sonoma virtual machine r=jrmuizel,haik
Adds a search for AppleParavirtGPUs found on macOS virtual machines.

Contributed by ran1@fastlizard4.org.

Differential Revision: https://phabricator.services.mozilla.com/D186081
2023-10-31 06:14:16 +00:00
kriswright 5b3fe5f7fe Bug 1847347 - Implement applicationSupportsSecureRestorableState. r=mac-reviewers,haik
Along with resume session support we need to support secure state restoration. If I'm reading the AppKit documentation correctly (https://developer.apple.com/documentation/appkit/nsapplicationdelegate/3762521-applicationsupportssecurerestora?language=objc) then we're supposed to implement this ourselves with a true return value.

Differential Revision: https://phabricator.services.mozilla.com/D188947
2023-10-30 20:36:05 +00:00
Eitan Isaacson 8653b8bcc8 Bug 1845407 - Don't pump apple events before application starts. r=nika
When we call `nextEventMatchingMask` we send a "did launch app" notification to the OS workspace. If we do that before we call `[NSApp run]` accessibility isn't hooked up yet internally in AppKit and we fail to respond to a11y API queries.

Pumping Apple events is currently used for getting url requests in order to launch Firefox with the URLs loading correctly in a browser window. We can achieve the same result by using `application:openURLs:` in the delegate and calling `run` on the NSApp earlier and then stopping the loop in order to build the command line and finish initializing Firefox.

Also pumping the apple event queue should be deferred in `ProcessNextNativeEvent` until `[NSApp run]` is called.

Differential Revision: https://phabricator.services.mozilla.com/D184524
2023-10-27 16:28:13 +00:00
Norisz Fay cd9cb278d0 Backed out changeset 374f05be6d50 (bug 1845407) for causing bc failures on browser/components/* , browser/base/content/* CLOSED TREE 2023-10-25 06:45:34 +03:00
Eitan Isaacson 4313177f7f Bug 1845407 - Don't pump apple events before application starts. r=nika
When we call `nextEventMatchingMask` we send a "did launch app" notification to the OS workspace. If we do that before we call `[NSApp run]` accessibility isn't hooked up yet internally in AppKit and we fail to respond to a11y API queries.

Pumping Apple events is currently used for getting url requests in order to launch Firefox with the URLs loading correctly in a browser window. We can achieve the same result by using `application:openURLs:` in the delegate and calling `run` on the NSApp earlier and then stopping the loop in order to build the command line and finish initializing Firefox.

Also pumping the apple event queue should be deferred in `ProcessNextNativeEvent` until `[NSApp run]` is called.

Differential Revision: https://phabricator.services.mozilla.com/D184524
2023-10-24 16:27:06 +00:00
Brad Werth d9c451e9eb Bug 1850692: Make nsCocoaWindow handle fullscreen change failures more flexibly. r=mac-reviewers,mstange
Receiving the nsWindowDelegate methods windowDidFailToEnterFullScreen or
windowDidFailToExitFullScreen does not definitively indicate what the
final fullscreen state will be. This change stops listening for those
delegate methods and instead makes the later calls to
windowDidEnterFullScreen or windowDidExitFullscreen handle the case of
ending up in an unexpected state.

Differential Revision: https://phabricator.services.mozilla.com/D187316
2023-10-18 20:11:56 +00:00