Commit Graph
755 Commits
Author SHA1 Message Date
David P 805b8742ba Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig
Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
2024-07-04 07:48:04 +00:00
Emilio Cobos Álvarez e5de6363a8 Bug 1902315 - Remove other widget z-level fiction. r=win-reviewers,rkraesig,geckoview-reviewers,spohl,m_kato
This comes back to bug 42557 and co. It only does something
half-reasonable on Windows (on macOS we just lie and make z-order
tracking be latest-active tracking), and given we don't use the special
zorder flags elsewhere I'm pretty sure we should be able to just rip
this off... On some DEs like Wayland we can't re-stack toplevel windows.

Differential Revision: https://phabricator.services.mozilla.com/D213602
2024-06-19 07:47:36 +00:00
Masayuki Nakano b3c5045ec1 Bug 1675847 - part 5: Make contextmenu event dispatchers use WidgetPointerEvent or PointerEvent r=smaug,pip-reviewers,devtools-reviewers,nchevobbe,mconley
`eContextMenu` event may be fired from `widget`.  Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch.  This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`

Differential Revision: https://phabricator.services.mozilla.com/D213003
2024-06-14 00:18:48 +00:00
Masayuki Nakano fb5048e05b Bug 1675847 - part 1: Rename eMouseClick and eMouseAuxClick r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212999
2024-06-14 00:18:46 +00:00
Álvaro Costa 6376e4719d Bug 1830667 - Update APZCTreeManager::mDPI when display DPI changes. r=dlrobertson,win-reviewers,handyman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202280
2024-02-24 19:25:30 +00:00
Makoto Kato c76c890a9b Bug 1878793 - Some drag events aren't fired on xorigin frame. r=botond
This is a regression by bug 1586471.

We should use ReceiveInputEvent for all drag events on desktop.

Also, GV issue is bug 1878819 since we have to consider more when APZ
controller thread and main thread are different. But GV doesn't turn
on fission yet.

And, there is no way to add tests for native drag and drop operations.

Differential Revision: https://phabricator.services.mozilla.com/D200783
2024-02-08 02:36:23 +00:00
Makoto Kato d6e3af6a30 Bug 1586471 - Part 1. Handle WidgetDragEvent by DispatchInputEvent. r=botond
Main thread and APZ controller thread are different on GeckoView. Some
drag events cannot be converted to InputData and aren't handled by APZ.

So we need consider drag events more for GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D197329
2024-01-28 07:49:53 +00:00
Gijs Kruitbosch 67adf4dc07 Bug 1833814 - change nsIWidget's cursor logic, r=emilio,win-reviewers,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D195549
2024-01-22 20:42:50 +00:00
Emilio Cobos Álvarez dc1a95f501 Bug 1874766 - Relax assertion in nsBaseWidget::UpdateZoomConstraints. r=botond
It doesn't hold if the load event is delayed a bit, but it breaking
shouldn't change any behavior / shouldn't matter in practice.

Differential Revision: https://phabricator.services.mozilla.com/D198785
2024-01-17 20:33:35 +00:00
Daniel Holbert 8b516f4d3b 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 97827e82ee 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 b2ab6949c5 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 4de2b14023 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 96374419ea 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 49003e0340 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 f4a321758b 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 bcbcc4e768 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 153ae02a3a 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 bb012ebfe3 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 5de9747bc0 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 71bf1e503b 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 c6b19a2fce 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 7b17956fac 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 f4429149ec 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 b05e6c0ce4 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 996101dee3 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 7d3fb4136a 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 e3921efc1e 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 98f4f2ad20 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 3fba33ca05 Backed out changeset 0f2913c81558 (bug 1809430) for causing multiple failures. 2023-01-17 03:13:06 +02:00
Emilio Cobos Álvarez 02de9ebb1f 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 25327b5629 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 8473a98bd4 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 f18298c006 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 34bd563ec8 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 1db61487d7 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 d52a0e8301 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 3eac621efe 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 f3a35ebaa0 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 c0411ee9db 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 e7ad03fefc 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 f58483a72d 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 363946e17f 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 f8f1c8a774 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 7e753f9368 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 e2f7d11017 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 2d98dcd09f 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 36c0b3bfb6 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 f1b2b7d85c 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 55327aad6b 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