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

746 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert 74ff75268a Bug 1848628: Null-check swipe tracker before cleaning it up, in nsBaseWidget::SwipeFinished. r=hiro
It seems unexpected that the swipe tracker would be non-null when a swipe
finishes, but there are several codepaths that can clear it, which might
conceivably fire while the SwipeFinished callback is in the queue to be
dispatched.

Note that before bug 1837226, SwipeFinished just nulled out the pointer, which
was harmless if it was already null.  My patch in bug 1837226 made us start
calling a method as well, and that created a new opportunity for a null-deref
crash here if the pointer happens to be null when we reach this function.

Differential Revision: https://phabricator.services.mozilla.com/D186204
2023-08-15 15:39:12 +00:00
Chris Peterson d34094627d Bug 1847154 - cocoa: remove some unnecessary OnMojaveOrLater() and OnCatalinaOrLater() version checks. r=mac-reviewers,bradwerth
Firefox versions >= 116 only support macOS >= 10.15. Mojave is macOS 10.14. Catalina is macOS 10.15.

Also stop including unused "nsCocoaFeatures.h" in files with no macOS version checks.

Differential Revision: https://phabricator.services.mozilla.com/D185505
2023-08-10 15:27:05 +00:00
Hiroyuki Ikezoe 054d76bba8 Bug 1839198 - Skip processing swipe-to-navigation stuff in PiP windows. r=botond,pip-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D181418
2023-06-27 21:20:08 +00:00
Hiroyuki Ikezoe b976eb1152 Bug 1839198 - Move mIsPIPWindow into nsBaseWidget. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D181417
2023-06-27 21:20:08 +00:00
Natalia Csoregi d39daca2ad Backed out 2 changesets (bug 1839198) for causing failures on browser_disableSwipeGestures.js. CLOSED TREE
Backed out changeset 7571cac8dc05 (bug 1839198)
Backed out changeset 7a7eaa3f754d (bug 1839198)
2023-06-23 03:31:03 +03:00
Hiroyuki Ikezoe 64aa4601c5 Bug 1839198 - Skip processing swipe-to-navigation stuff in PiP windows. r=botond,pip-reviewers,mconley
Depends on D181417

Differential Revision: https://phabricator.services.mozilla.com/D181418
2023-06-22 20:53:18 +00:00
Hiroyuki Ikezoe c2df274d5e Bug 1839198 - Move mIsPIPWindow into nsBaseWidget. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D181417
2023-06-22 20:53:18 +00:00
Hiroyuki Ikezoe c146abc3d5 Bug 1835712 - Add a new flag to InputAPZContext to indicate the state we didn't handle the event on the main-thread. r=botond
And use it to tell whether it's safe to inform the handled result to APZ.

Differential Revision: https://phabricator.services.mozilla.com/D180760
2023-06-22 03:01:44 +00:00
sotaro dd38543e1e Bug 1837938 - Fix fallback from SW-WR + OpenGL to SW-WR r=gfx-reviewers,lsalzman
Fallback from SW-WR + OpenGL to SW-WR is not implemented yet. Since the fallback is not expected to be used on release.

Fallback implementation is borrowed from the fallback process of "WebRender + D3D11" and gfxVars::AllowSoftwareWebRenderD3D11() handling.

Differential Revision: https://phabricator.services.mozilla.com/D180645
2023-06-13 05:18:03 +00:00
Daniel Holbert d8ca619c81 Bug 1837226 part 3: Make nsBaseWidget::SwipeFinished destroy its SwipeTracker before clearing pointer. r=hiro
This new call should generally be a no-op, since we already un-register before
we get here, i.e. before we call SwipeFinished on the widget. This new call is
just to be extra-sure we're unregistered.  With this change, nsBaseWidget is
now consistent about calling Destroy before clearing its mSwipeTracker pointer.

Depends on D180240

Differential Revision: https://phabricator.services.mozilla.com/D180241
2023-06-07 22:02:30 +00:00
Andrew Osmond 90299327da Bug 1827222 - GPUProcessManager should not allow (re)initialization during shutdown. r=jnicol
We already avoid launching the GPU process during shutdown, but shutdown
could happen after we initiated the launch and before it completes. Top
level IPDL protocols assert that we don't create them during shutdown,
so we need to be more diligent about checking for that.

Differential Revision: https://phabricator.services.mozilla.com/D175054
2023-05-02 14:56:26 +00:00
Hiroyuki Ikezoe d96b738428 Bug 1784772 - Queue SwipeEventQueue only if we don't know whether the pan event wasn't consumed by APZ. r=botond
If we queue the SwipeEventQueue in the case where the corresponding pan-start
event was consumed by the root content APZC, we wait for a response from the
content. And if the consumed pan-start event scrolled to the edge of the scroll
container and if the new scrolled position has been reached to the content
process before we tell whether the scroll position of the scroll container is
at the edge [1], we report it back to the SwipeTracker as the event should be
an event as a start of swipe navigation gestures. Thus, once after we got a
pan-end event, we trigger a swipe navigation. It results timeouts on a test case
waiting for an APZ:TransformEnd notification which never happens due to the page
navigation.

There's also a similar race condition where a pan-start event was consumed by a
non-root content APZC. But I haven't been able to reproduce the similar case
manually so I just filed bug 1821967 for the race and I am not going to handle
the race here. Note that I haven't been able to reproduce the original race
condition manually either though.

[1] https://searchfox.org/mozilla-central/rev/2f9a79d1c4ae7090cf50d93be86ba9dc2767a733/dom/events/EventStateManager.cpp#3727-3728

Differential Revision: https://phabricator.services.mozilla.com/D172391
2023-03-14 21:01:01 +00:00
Brad Werth ce9e905fc3 Bug 1768495 Part 1: Add a method nsIWidget::PauseOrResumeCompositor, and override it in nsCocoaWindow. r=gfx-reviewers,emilio,ahale
This change does not affect behavior, it's just prepatory for a later
caller to the newly-defined method.

Differential Revision: https://phabricator.services.mozilla.com/D169344
2023-02-28 23:16:56 +00:00
Cristian Tuns b25ff1fab8 Backed out 3 changesets (bug 1768495) for causing reftest failures in 1478035.html CLOSED TREE
Backed out changeset 6a48a9418fb3 (bug 1768495)
Backed out changeset ac0c0d68e31d (bug 1768495)
Backed out changeset 74c1903a5df6 (bug 1768495)
2023-02-09 21:31:43 -05:00
Brad Werth 5a99e78cfc Bug 1768495 Part 1: Add a method nsIWidget::PauseOrResumeCompositor, and override it in nsCocoaWindow. r=gfx-reviewers,emilio,ahale
This change does not affect behavior, it's just prepatory for a later
caller to the newly-defined method.

Differential Revision: https://phabricator.services.mozilla.com/D169344
2023-02-09 23:44:19 +00:00
Makoto Kato a81830ccdb Bug 1812938 - Part 1. GetWidgetScreen returns Screen instead of nsIScreen. r=emilio,geckoview-reviewers,owlish
`nsIWidget` isn't scriptable, so it is unnecessary to return `nsIScreen` for
`GetWidgetScreen`.

Differential Revision: https://phabricator.services.mozilla.com/D168029
2023-02-06 04:51:26 +00:00
Emilio Cobos Álvarez e7fa71f013 Bug 1813303 - Clean up nsIWidget::SetNonClientMargins usage. r=spohl
Make it take a const reference and simplify callers.

No behavior change, but noticed while looking through this code.

Differential Revision: https://phabricator.services.mozilla.com/D168199
2023-01-28 21:43:47 +00:00
Emilio Cobos Álvarez 95520cabbd 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-26 11:19:16 +00:00
Emilio Cobos Álvarez 9e530f224a Bug 1811834 - Clean up nsWidgetInitData. r=cmartin,geckoview-reviewers,calu
Move it to the mozilla::widget namespace.

Use enum classes for transparency, popup type, popup level, etc.

Mostly automated with sed, but there were a few manual changes required
as well in windows code because they relied on Atomic<TransparencyMode>
working (which now doesn't because TransparencyMode is 1 byte instead of
4 bytes).

Differential Revision: https://phabricator.services.mozilla.com/D167537
2023-01-23 23:58:41 +00:00
Florian Quèze 05ee3fb7a5 Bug 1803387 - destroy the compositor as soon as a window is closed, instead of waiting for it to be garbage collected, r=nical.
Differential Revision: https://phabricator.services.mozilla.com/D167075
2023-01-18 15:53:45 +00:00
Sandor Molnar e16941d56b Backed out changeset 0f2913c81558 (bug 1809430) for causing multiple failures. 2023-01-17 03:13:06 +02:00
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 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
Emilio Cobos Álvarez f62fac0678 Bug 1807482 - Remove gRollupListener. r=stransky
This is just preliminary clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D165734
2023-01-03 13:39:43 +00:00
Olli Pettay 5d21de32ac Bug 1807812 - Remove WidgetEventTime::mTime, r=masayuki,geckoview-reviewers,m_kato
HTMLSelectEventListener changes are needed, since currently that code works somewhat by accident given that
mTime often contains totally bogus values, like PR_IntervalNow(). Those changes then reveal issues also in
browser_editAddressDialog.js.

Differential Revision: https://phabricator.services.mozilla.com/D165618
2023-01-02 12:31:40 +00:00
Hiroyuki Ikezoe 3a5650ace5 Bug 1794070 - Make a pan start event wait for the browser gesture code response. r=botond,dlrobertson
So that APZ can wait to handle the event to do overscrolling until the browser
responds that the event wasn't used for gestures.

Differential Revision: https://phabricator.services.mozilla.com/D160438
2022-11-22 06:52:53 +00:00
Hiroyuki Ikezoe d32e0125e8 Bug 1794070 - Introduce PanGestureInput::AllowsSwipe(). r=botond
Differential Revision: https://phabricator.services.mozilla.com/D160437
2022-11-22 06:52:52 +00:00
Hiroyuki Ikezoe f7ce055162 Bug 1794070 - Refer mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection flag instead of calling SwipeTrackker::CanTriggerSwipe(). r=botond
And rename mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection to
mMayTriggerSwipe.

So basically once after the flag is set, we should use it.

Differential Revision: https://phabricator.services.mozilla.com/D160436
2022-11-22 06:52:52 +00:00
Butkovits Atila 887a77ba5f Backed out 13 changesets (bug 1794070) for causing failures at browser_test_swipe_gesture.js. CLOSED TREE
Backed out changeset afe487b23e1c (bug 1794070)
Backed out changeset b119052f690d (bug 1794070)
Backed out changeset 733188f6b7ca (bug 1794070)
Backed out changeset 53273c86140a (bug 1794070)
Backed out changeset e2e39e61efbe (bug 1794070)
Backed out changeset 93b240feb781 (bug 1794070)
Backed out changeset 78aea5c32e14 (bug 1794070)
Backed out changeset 158008a6363b (bug 1794070)
Backed out changeset 3c3e76c8bf49 (bug 1794070)
Backed out changeset 39beb7abc321 (bug 1794070)
Backed out changeset 0ded01fbbd9e (bug 1794070)
Backed out changeset cf4552e5e11b (bug 1794070)
Backed out changeset 317ee240609d (bug 1794070)
2022-11-21 13:41:34 +02:00
Hiroyuki Ikezoe 024f31065c Bug 1794070 - Make a pan start event wait for the browser gesture code response. r=botond
So that APZ can wait to handle the event to do overscrolling until the browser
responds that the event wasn't used for gestures.

Differential Revision: https://phabricator.services.mozilla.com/D160438
2022-11-21 03:10:08 +00:00
Hiroyuki Ikezoe 5a42df888d Bug 1794070 - Introduce PanGestureInput::AllowsSwipe(). r=botond
Differential Revision: https://phabricator.services.mozilla.com/D160437
2022-11-21 03:10:08 +00:00
Hiroyuki Ikezoe 5b39846aeb Bug 1794070 - Refer mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection flag instead of calling SwipeTrackker::CanTriggerSwipe(). r=botond
And rename mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection to
mMayTriggerSwipe.

So basically once after the flag is set, we should use it.

Differential Revision: https://phabricator.services.mozilla.com/D160436
2022-11-21 03:10:07 +00:00
Emilio Cobos Álvarez a8a5c8fe6a Bug 1798213 - For widget-less pages keep defaulting to primary screen scale factor. r=tnikkel,layout-reviewers,extension-reviewers,robwu
This restores the previous behavior in a somewhat more principled way.

The extensions code is still broken in multi-monitor cases, but that's a
more complicated fix.

Differential Revision: https://phabricator.services.mozilla.com/D161997
2022-11-16 15:52:07 +00:00
Razvan Cojocaru 1629218702 Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Andrew Osmond 9d245b8325 Bug 1794722 - Part 2. Remove all uses of gfxVars::UseWebRender(). r=jrmuizel,media-playback-reviewers,alwu
This is always true.

Differential Revision: https://phabricator.services.mozilla.com/D160121
2022-10-28 12:36:06 +00:00
Cristian Tuns 1303ee58d8 Backed out 3 changesets (bug 1794722) for causing multiple failures on RemoteProcessMonitor CLOSED TREE
Backed out changeset 0217af5b1aa6 (bug 1794722)
Backed out changeset d7805be9dfb3 (bug 1794722)
Backed out changeset 0093f071f1a5 (bug 1794722)
2022-10-27 20:52:36 -04:00
Andrew Osmond 93abf26cbc Bug 1794722 - Part 2. Remove all uses of gfxVars::UseWebRender(). r=jrmuizel,media-playback-reviewers,alwu
This is always true.

Differential Revision: https://phabricator.services.mozilla.com/D160121
2022-10-28 00:08:03 +00:00
Ray Kraesig 5687bd89ee Bug 1776895 - [6/6] Add logging for fullscreen entry/exit r=cmartin,handyman
Add logging for fullscreen position-state saving and restoration.

Differential Revision: https://phabricator.services.mozilla.com/D153411
2022-09-20 16:22:58 +00:00
Ray Kraesig ec80afc7a4 Bug 1776895 - [5/6] Save and restore original relative position r=cmartin,handyman
When entering fullscreen and saving the original position of a window,
also save the position to which it was moved.

When leaving fullscreen, keep the window on the same screen. Restore its
_screen-relative_ position, rather than its absolute position.

Differential Revision: https://phabricator.services.mozilla.com/D153410
2022-09-20 16:22:57 +00:00
Ray Kraesig 9f7b5a31e1 Bug 1776895 - [4/6] adjust callsite of HideWindowChrome r=cmartin,handyman
`HideWindowChrome(false)` may change the reported window size on Mac:
the OS menu bar appears at the top of the screen, and this will cause the
window to shrink if it was fullscreen.

This isn't a problem yet, since we don't check the window dimensions
when exiting fullscreen... but the following commit will do exactly
that. Delay calling `HideWindowChrome` until the last possible minute --
but make sure that it _does_ get called.

Since HideWindowChrome(true) does not presently change the window size
(see bug 498835), no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D154469
2022-09-20 16:22:57 +00:00
Ray Kraesig 360f7f624e Bug 1776895 - [3/6] Cleanup: specialize further to desktop pixels r=cmartin
Use desktop pixels everywhere:
 - Store the old window position as a `DesktopRect`.
 - Since `GetRectDisplayPix` is infallible, use the convenience getter
   that hands us a `DesktopIntRect`.
 - Add a helper function that wraps `Resize()` and takes any `Rect`
   which uses `DesktopPixel`s.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153409
2022-09-20 16:22:56 +00:00
Ray Kraesig 86239750b0 Bug 1776895 - [2/6] Cleanup: remove BoundsUseDesktopPixels() condition r=cmartin
A window is fullscreenable iff it's a desktop window (that is, a
positional child of the desktop rather than of another window) -- and
desktop windows are the windows which use desktop-pixel units in
Resize().

Code coverage confirms that the branch when `BoundsUseDesktopPixels()`
returns `false` is never taken in tests.

Under the (hopefully justified) assumption that it's never taken at all,
no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153408
2022-09-20 16:22:56 +00:00
Ray Kraesig 44d02f76a7 Bug 1776895 - [1/6] Cleanup: use UniquePtr rather than manual allocation r=cmartin
No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153407
2022-09-20 16:22:56 +00:00
Emilio Cobos Álvarez fb6380190c Bug 1786525 - Don't update untransformed anchor rect when moved by move-to-rect. r=stransky
Otherwise, it changes the move-to-rect inputs, which can change the
output as well, making us move the anchor all the way to the right.

You could, I guess, consider this a mutter bug of sorts, because it
feels weird that you pass it an anchor that has been a `move-to-rect`
output and you get another rect as an output.

But also, it's kinda silly that we're doing that to begin with, so avoid
it by telling the popup frame whether it's been positioned / moved by
move-to-rect (and keeping the anchor in that case).

The reason this works on my setup without "Large text" is just dumb luck
(the front-end computes a max-height for the panel that is small enough
to fit on the screen).

Differential Revision: https://phabricator.services.mozilla.com/D155406
2022-08-30 09:30:27 +00:00
Sandor Molnar 9d7f9853a2 Backed out changeset bb1d2a4a5570 (bug 1786525) for causing build bustages in xpfe/appshell/AppWindow.cpp CLOSED TREE 2022-08-30 01:26:00 +03:00
Emilio Cobos Álvarez cf74fba975 Bug 1786525 - Don't update untransformed anchor rect when moved by move-to-rect. r=stransky
Otherwise, it changes the move-to-rect inputs, which can change the
output as well, making us move the anchor all the way to the right.

You could, I guess, consider this a mutter bug of sorts, because it
feels weird that you pass it an anchor that has been a `move-to-rect`
output and you get another rect as an output.

But also, it's kinda silly that we're doing that to begin with, so avoid
it by telling the popup frame whether it's been positioned / moved by
move-to-rect (and keeping the anchor in that case).

The reason this works on my setup without "Large text" is just dumb luck
(the front-end computes a max-height for the panel that is small enough
to fit on the screen).

Differential Revision: https://phabricator.services.mozilla.com/D155406
2022-08-29 21:47:34 +00:00
Ray Kraesig d37d1556d3 Bug 1786226 - Revert all patches for regressing bug 1776895 r=cmartin
This reverts the following commits:
- 21f1ada7ee6ad5839fc0d9bc98e1ff2d558ef6e7
- cde5393917c483a3516f4c883af02834ddbf11d8
- 3d2dc8de0e7147d0d991c16c29ad9a8678a25635
- 4b17fb88efc581522c0edf0740da4c54c539d39a
- 7b0893449764054af7795df66c0c2e83a370d620
- bcc0fa996f5fd7cc677ca2a5e97329dcd6b74a04
- 9547ab55535d9713c95bc3344d1cc1357520ba92

Differential Revision: https://phabricator.services.mozilla.com/D155237
2022-08-22 18:30:03 +00:00
Ryan VanderMeulen b16f6be00a Bug 1776895 - Fix file-whitespace linter error. r=bustage on a CLOSED TREE 2022-08-17 15:08:03 -04:00
Ray Kraesig d1411e990f Bug 1776895 - [6/6] Add logging for fullscreen entry/exit r=cmartin
Add logging for fullscreen position-state saving and restoration.

Differential Revision: https://phabricator.services.mozilla.com/D153411
2022-08-17 18:51:32 +00:00
Ray Kraesig c4d109da63 Bug 1776895 - [5/6] Save and restore original relative position r=cmartin
When entering fullscreen and saving the original position of a window,
also save the original position of its screen.

When leaving fullscreen, keep the window on the same screen. Restore its
_screen-relative_ position, rather than its absolute position.

Differential Revision: https://phabricator.services.mozilla.com/D153410
2022-08-17 18:51:32 +00:00