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

31153 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 5077bb750f Bug 1809430 - Clean up ClientToWindowRect. r=cmartin,mstange
Make it return a margin from client area to window area, and add an
explicit function to get the size difference.

No behavior change.

Depends on D166428

Differential Revision: https://phabricator.services.mozilla.com/D166431
2023-01-16 23:35:34 +00:00
Emilio Cobos Álvarez 58fca810d3 Bug 1809430 - Fix nsCocoaWindow::ClientToWindowSize with custom non-client margins. r=mstange
Similar fix as for windows above, see the comment.

Depends on D166426

Differential Revision: https://phabricator.services.mozilla.com/D166428
2023-01-16 23:29:56 +00:00
Emilio Cobos Álvarez cb551614ea Bug 1809430 - Fix nsWindow::ClientToWindowSize with custom non-client margins. r=cmartin
This fixes the failures that got the patch from bug 1807838 backed out
on Windows.

MacOS needs a similar fix.

Differential Revision: https://phabricator.services.mozilla.com/D166426
2023-01-16 23:29:56 +00:00
Emilio Cobos Álvarez 2f3519d8e0 Bug 1809057 - Make sure all sizemode changes do go through FrameState::SetSizeModeInternal. r=rkraesig
I wrote this while debugging / fixing bug 1806438, and this is kind of
related and needed to fix that bug in one of my machines.

This ensures that all size mode changes go through a central place.

In order to do that, we need to pass whether we need to ShowWindow()
since doing it redundantly in some cases like windows-triggered sizemode
changes would break stuff.

Differential Revision: https://phabricator.services.mozilla.com/D166254
2023-01-16 21:41:37 +00:00
Cosmin Sabou 6ac24faba9 Backed out changeset 4debd5a21cd9 (bug 1809057) for causing bc windows failures on browser_test_data_text_csv.js. CLOSED TREE 2023-01-17 01:01:52 +02:00
Emilio Cobos Álvarez 472815d00b Bug 1809057 - Make sure all sizemode changes do go through FrameState::SetSizeModeInternal. r=rkraesig
I wrote this while debugging / fixing bug 1806438, and this is kind of
related and needed to fix that bug in one of my machines.

This ensures that all size mode changes go through a central place.

In order to do that, we need to pass whether we need to ShowWindow()
since doing it redundantly in some cases like windows-triggered sizemode
changes would break stuff.

Differential Revision: https://phabricator.services.mozilla.com/D166254
2023-01-16 21:41:37 +00:00
stransky a17d4b8e52 Bug 1809350 [Wayland] Unlock mouse pointer before repeated lock r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166909
2023-01-16 21:04:44 +00:00
Florian Quèze d7356251cd Bug 1768920 - Avoid polling every 5 seconds in nsUserIdleService, r=dthayer,geckoview-reviewers,owlish.
This changes the behavior in a few ways:
- the 'active' notification is now only fired when a new user event has been received by Firefox, rather than by any application on the entire system.
- the 'active' notification will fire immediately when Firefox receives a new event. Before the patch is was fired within 5s of the user returning on some plateforms (eg. Mac) and immediately on some other platforms that already called ResetIdleTimeout (windows, gtk, android). I'm not sure if these existing calls to ResetIdleTimeout are really needed, nor if they add significant overhead.
- when an idle observer has been notified of 'idle', it won't be notified again until Firefox receives events. Before the patch, if the user used other applications while Firefox was in the background, we would keep sending active and idle notifications to our idle observers. This behavior was probably initially intended when the nsUserIdleService was introduced to support the use case of instant messaging clients, but doesn't seem to match the expectations of the existing consumers of the service.

Differential Revision: https://phabricator.services.mozilla.com/D166306
2023-01-16 19:53:33 +00:00
Florian Quèze a5ccc617c6 Bug 1768920 - Add profiler markers to see which code uses user idle observers and when they fire, r=dthayer.
Differential Revision: https://phabricator.services.mozilla.com/D166305
2023-01-16 19:53:33 +00:00
Edgar Chen e5fe0a40c0 Bug 1796548 - Introduce a generic method to check clipboard capabilities in nsIClipboard; r=geckoview-reviewers,nika,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D166475
2023-01-16 19:50:17 +00:00
Neil Deakin 562eebb8ca Bug 1806730, remove the redundant filename length checking that ValidateFileNameForSaving already does, r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D165477
2023-01-16 18:15:02 +00:00
Otto Länd e6db75f93c Bug 1810487, 1810487: apply code formatting via Lando
# ignore-this-changeset
2023-01-16 19:50:08 +00:00
Emilio Cobos Álvarez 89e7b68318 Bug 1810487 - Remove unused JS-exposed nsIWinTaskbar.prepareFullScreen. r=rkraesig
And rename the HWND version of it to just prepareFullScreen.

Depends on D166895

Differential Revision: https://phabricator.services.mozilla.com/D166896
2023-01-16 17:30:08 +00:00
Emilio Cobos Álvarez 65a603aa1c Bug 1810487 - Fix non-unified build on nsWindowTaskbarConcealer. r=rkraesig
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D166895
2023-01-16 17:30:08 +00:00
serge-sans-paille 92df009ab9 Bug 426177 - Alert user when selecting unreadable input file r=emilio
The change is done at the nsFilePicker level, when it's in open mode.

Differential Revision: https://phabricator.services.mozilla.com/D166419
2023-01-16 16:13:45 +00:00
Emilio Cobos Álvarez 67d53447ec Bug 1809742 - Remove nativeThemePref annotations. r=dshin
Done automatically with https://github.com/emilio/reftest-manifest

```
$ cargo run -- path/to/gecko/layout/reftests/reftests.list
```

And committing everything but the reftest-sanity changes (which use true/false
unconditionally).

Differential Revision: https://phabricator.services.mozilla.com/D166600
2023-01-13 21:18:08 +00:00
Emilio Cobos Álvarez 79af3ab38f Bug 1809630 - Make thin scrollbars on Windows have a reasonable minimum size. r=tnikkel,layout-reviewers
The way the code was set up before this patch ends up causing minimum
scrollbar sizes to be 0x0 for thin (non-overlay) scrollbars.

This is rather problematic, since it means that we would always try to
place the scrollbar even if it doesn't fit (think of an element with
height: 0).

This causes a lot of extra reflow, which with very complex layouts is
even worse, because the extra scrollframe reflows cause us to miss the
flex caches, causing O(n^2) performance.

Add assertions to make sure we never end up with a zero minimum
scrollbar size, and change the size computation to match for both
thin and thick scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D166756
2023-01-13 20:42:27 +00:00
Edgar Chen 66a41e0e4c Bug 1809918 - Make WidgetPointerHelper use int32_t for twist; r=smaug
For Windows, the `twist` is from `POINTER_PEN_INFO::rotation`, https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer_pen_info,
which is `UINT32`, but the value is normalized in a range of 0 to 359, so it is
safe to convert into `int32_t`.

For Mac, the `twist` is from `NSEvent::rotation`, https://developer.apple.com/documentation/appkit/nsevent,
which is `Float`, but we normalize it in a range of 0 to 359.

Differential Revision: https://phabricator.services.mozilla.com/D166726
2023-01-13 08:35:44 +00:00
Edgar Chen 56e854ac62 Bug 1809918 - Make WidgetPointerHelper use int32_t for tiltX/tiltY; r=smaug
For Windows, the `tiltX`/`tiltY` are from `POINTER_PEN_INFO::tiltX`/`tiltY`,
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer_pen_info,
which are `INT32`.

For Mac, the `tiltX`/`tiltY` are from `NSEvent::tilt`, https://developer.apple.com/documentation/appkit/nsevent,
which is a `CGPoint`, https://developer.apple.com/documentation/corefoundation/cgpoint,
the properties are `Double`, using `int32_t` still makes more sense.

Differential Revision: https://phabricator.services.mozilla.com/D166725
2023-01-13 08:35:44 +00:00
Cristian Tuns 3d3df76b69 Backed out changeset 51619d94e92d (bug 1809630) for causing reftest failures on percent-height-overflowing-image-1.html CLOSED TREE 2023-01-13 01:11:46 -05:00
Emilio Cobos Álvarez aaa4049b01 Bug 1809630 - Make thin scrollbars on Windows have a reasonable minimum size. r=tnikkel,layout-reviewers
The way the code was set up before this patch ends up causing minimum
scrollbar sizes to be 0x0 for thin (non-overlay) scrollbars.

This is rather problematic, since it means that we would always try to
place the scrollbar even if it doesn't fit (think of an element with
height: 0).

This causes a lot of extra reflow, which with very complex layouts is
even worse, because the extra scrollframe reflows cause us to miss the
flex caches, causing O(n^2) performance.

Add assertions to make sure we never end up with a zero minimum
scrollbar size, and change the size computation to match for both
thin and thick scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D166756
2023-01-13 04:49:55 +00:00
Edgar Chen bacb13e934 Bug 1809920 - Make WidgetPointerEvent use int32_t for mWidth/mHeight; r=smaug
The value are assigned from `Touch::mRadius`, https://searchfox.org/mozilla-central/rev/893a8f062ec6144c84403fbfb0a57234418b89cf/dom/events/PointerEventHandler.cpp#550-551,
which is a `IntPointTyped<LayoutDevicePixel>`, https://searchfox.org/mozilla-central/rev/893a8f062ec6144c84403fbfb0a57234418b89cf/gfx/2d/Point.h#66.

Differential Revision: https://phabricator.services.mozilla.com/D166696
2023-01-12 20:17:51 +00:00
Emilio Cobos Álvarez 24c5d38a19 Bug 1809113 - Allow minimized and fullscreen state to co-exist. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D166437
2023-01-12 13:30:38 +00:00
Noemi Erli 893a8f062e Backed out 2 changesets (bug 1809057) for causing failures in browser_startup_flicker.js CLOSED TREE
Backed out changeset be4ba160f2a9 (bug 1809057)
Backed out changeset 1de22258a95c (bug 1809057)
2023-01-11 02:49:44 +02:00
Emilio Cobos Álvarez 239845ceb2 Bug 1809057 - Do the ShowWindowAndFocus::No on the right message.
MANUAL PUSH: Orange fix CLOSED TREE
2023-01-11 00:24:44 +01:00
Emilio Cobos Álvarez 4b4f3738f4 Bug 1809057 - Make sure all sizemode changes do go through FrameState::SetSizeModeInternal. r=rkraesig
I wrote this while debugging / fixing bug 1806438, and this is kind of
related and needed to fix that bug in one of my machines.

This ensures that all size mode changes go through a central place.

In order to do that, we need to pass whether we need to ShowWindow()
since doing it redundantly in some cases like windows-triggered sizemode
changes would break stuff.

Differential Revision: https://phabricator.services.mozilla.com/D166254
2023-01-10 21:44:17 +00:00
Emilio Cobos Álvarez 70e1564aac Bug 1806438 - Make sure not to save/restore bounds when going from/into minimized state. r=rkraesig
Otherwise we might restore nonsensical bounds because Windows moves
minimized windows to crazy positions like -32000, -32000.

Differential Revision: https://phabricator.services.mozilla.com/D165913
2023-01-10 21:29:40 +00:00
Ray Kraesig 53e40632bf Bug 1808632 - TaskbarPreviewCallback::Done(): modernization and error-checking r=cmartin
Properly test for and handle errors in target-surface creation and
mapping.

(Additionally, perform some drive-by cleanup/modernization.)

Differential Revision: https://phabricator.services.mozilla.com/D166126
2023-01-10 19:40:33 +00:00
David Shin 56ddcf4ce0 Bug 1799920: Use async move on printing to file on Linux. r=nika,emilio
Differential Revision: https://phabricator.services.mozilla.com/D166112
2023-01-09 22:48:40 +00:00
Edgar Chen 323802a44b Bug 1762392 - Part 3: Make Clipboard support pasting file; r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D142634
2023-01-09 18:27:38 +00:00
Edgar Chen 52a0cff547 Bug 1762392 - Part 2: Put utility functions for NSPasteboardItem to nsCocoaUtils; r=spohl
So that we could reuse them in Clipboard code.

Differential Revision: https://phabricator.services.mozilla.com/D142572
2023-01-09 18:27:37 +00:00
Edgar Chen b01c11e8d8 Bug 1762392 - Part 1: Move pasteboard type declarations to nsCocoaUtils; r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D162569
2023-01-09 18:27:37 +00:00
Emilio Cobos Álvarez 56be5080d2 Bug 1807687 - Simplify Windows keyboard indicator setting handling. r=NeilDeakin
The only thing that can explain this is the WM_UPDATEUISTATE state
getting out of sync in a way that we think we need to unconditionally
show focus indicators for a window.

I tried to first make this less error prone (see patch above) but
digging more into these messages, I'm pretty sure we just don't need all
this code. See:

 * https://devblogs.microsoft.com/oldnewthing/20130516-00/?p=4343
 * https://devblogs.microsoft.com/oldnewthing/20130517-00/?p=4323

In particular, this is intended to be a windows feature to not show
keyboard indicators on dialogs until you use the keyboard. But that's
how Gecko dialogs behave already due to how :focus-visible behaves as
per:

  https://searchfox.org/mozilla-central/rev/43ee5e789b079e94837a21336e9ce2420658fd19/toolkit/components/prompts/src/CommonDialog.jsm#319

I haven't been able to repro this state, but sounds believable that it
could happen after opening a native dialog or so on?

The purpose of this code is to implement the 'Underline access keys' in
the Keyboard Accessibility control panel of windows.

There's an easier way of tracking this, via the SPI_GETKEYBOARDCUES SPI,
documented in:

  https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa

Hook that into LookAndFeel rather than using custom IPC and so on.

Differential Revision: https://phabricator.services.mozilla.com/D165578
2023-01-09 18:19:03 +00:00
Tyler Paplham eb45a16afa Bug 1335111 - Changed shortcut link extensions to '.url' instead of '.URL'. r=rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D166250
2023-01-09 16:50:15 +00:00
Emilio Cobos Álvarez 9a75fd9a39 Bug 1809055 - Clean-up pointer and rect usage in nsWindow::OnWindowPosChang{ing,ed}. r=rkraesig
Wrote this while digging into bug 1806438. No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D166253
2023-01-09 16:23:47 +00:00
Emilio Cobos Álvarez dc2ca64ca9 Bug 1809054 - Cleanup rect usage in FullscreenTransitionInitData. r=rkraesig
Wrote this while digging into bug 1806438.

Differential Revision: https://phabricator.services.mozilla.com/D166252
2023-01-09 16:23:04 +00:00
stransky dd2b07f5b8 Bug 1803545 [Linux] Implement nsClipboard::AsyncGetData() r=nika,hsivonen
- Implement DataPromiseHandler class to hold clipboard data promise and related data during async gtk_clipboard_request_text/gtk_clipboard_request_contents call.
- Implement AsyncGetTextImpl() helper to get text from clipboard.
- Implement AsyncGetDataImpl() helper to get general data from clipboard.
- Implement nsClipboard::AsyncGetData() handler.

Differential Revision: https://phabricator.services.mozilla.com/D163925
2023-01-09 12:36:46 +00:00
Matthew Noorenberghe 7e380579bb Bug 1073717 - [Web Notifications] Add support for "silent" toast notifications on Windows. r=mhowell
Depends on D119590

Differential Revision: https://phabricator.services.mozilla.com/D119591
2023-01-07 01:03:53 +00:00
Matthew Noorenberghe dbdbcc0cc7 Bug 1073717 - [Web Notifications] Add support for "silent" notifications on macOS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D119590
2023-01-07 01:03:52 +00:00
Sandor Molnar 9804f3da4b Backed out changeset b74ad4f6e811 (bug 1644104) for causing mochitest failures in toolkit/components/alerts/test/test_principal.html 2023-01-06 23:50:59 +02:00
Nicholas Rishel c5a9446349 Bug 1644104 - Enable native notifications by default for Nightly on Windows. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D149180
2023-01-06 18:48:22 +00:00
Nicholas Rishel b1811895a7 Bug 1797679 - Post: Prevent Windows notifications from leaking URL from private browsing session. r=nalexander
When a notification's originating tab is closed, it remains in the action center and launches to the originating domain when clicked. When the notification is from a private browsing session, the originating domain leaks to a non-private context when a private browsing session is still active. This fixes the leak by closing the notification with it's originating tab.

Differential Revision: https://phabricator.services.mozilla.com/D164296
2023-01-06 18:36:24 +00:00
Nicholas Rishel ff4320e383 Bug 1797679 - Fall back to launching a new tab to the host port for Windows native notifications abandoned due to closed tabs. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D160460
2023-01-06 18:36:24 +00:00
Nicholas Rishel 47a9fb5513 Bug 1787004 - Fix notifications not closing when `notification.close()` is called. r=nalexander,geckoview-reviewers,smaug,jonalmeida
This adds context to `CloseAlert()` such that explicitly closing the notification e.g. `notification.close()` can be differentiated from a tab or window implicitly closing the notification. This is necessary as we want notifications to persist after a tab or window is closed for Windows.

This change in behavior is necessary to match user expectations. Users expect notifications to persist in the system tray and do not expect notifications to be lost due to a tab being closed. The content of the message is more important than the interaction in that lens. This change is also necessary for parity with Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D161024
2023-01-06 18:36:23 +00:00
Nicholas Rishel a5ab3c9cd6 Bug 1787004 - Pre: Refactor logic for hiding private notifications when the private browsing context is closed to share code from cleaning up notification data when the application quits. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D162178
2023-01-06 18:36:23 +00:00
Nicholas Rishel 75573819be Bug 1795974 - Allow Firefox to focus itself when a Windows native notification is clicked. r=nalexander,nika
Notifications are now routed through a notification DLL server, which receives permission to set the foreground window when invoked. When the server launches Firefox, the command line is redirected to the currently running application. An instance of Firefox running as a remote client doesn't meet Window's criteria for receiving the set foreground permission, breaking the chain of set foreground window permissions.

This change fixes the chain by piping the PID of the notification handling process such that the DLL server can grant it foreground permission directly.

Differential Revision: https://phabricator.services.mozilla.com/D160457
2023-01-06 18:36:23 +00:00
Nicholas Rishel fe7c957ba6 Bug 1795974 - Pre 2: Create Windows Toast Notifications utility header to share strings and functionality between the firefox.exe and notificationserver.dll. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D165350
2023-01-06 18:36:22 +00:00
Nicholas Rishel 8a411e49fa Bug 1797678 - Fix Windows native notifications interaction from prior Firefox instances and closed tabs. r=nalexander,Jamie,mossop
We need to ensure we're not in a `WndProc` callback context when interacting with native notification COM objects, which is currently a problem when called from the command line handler (see Bug 1805802). We achieve this by moving COM work onto a background task which defers processing until after `WndProc` returns.

Now that retrieving the fallback URL occurs on a background task waiting for it before returning would block the main thread. Making `handleWindowsTag` async introduced race conditions with commandline handling, requiring a `enterLastWindowClosingSurvivalArea`/`exitLastWindowClosingSurvivalArea` to prevent misbehavior in case early blank window is pref'd off. In order to simplify exit cleanup, the API was updated to return a `Promise`.

Differential Revision: https://phabricator.services.mozilla.com/D160458
2023-01-06 18:36:21 +00:00
Nicholas Rishel f684bc7343 Bug 1797678 - Pre 1: Clean up `ToastNotificationHandler.cpp`. r=nalexander
`nullptr` check cleanup, simplified string conversions, renames.

Differential Revision: https://phabricator.services.mozilla.com/D160456
2023-01-06 18:36:21 +00:00
Emilio Cobos Álvarez fd0099ee19 Bug 1807000 - Use a DataMutex in HeadlessCompositorWidget. r=gfx-reviewers,nical
Much like GtkCompositorWidget. Clean some stuff up while at it.

Differential Revision: https://phabricator.services.mozilla.com/D165957
2023-01-05 15:53:53 +00:00