Commit Graph

1044 Commits

Author SHA1 Message Date
stransky
10244992b7 Bug 1727836 [Wayland] Don't show popups at negative coordinates, r=emilio
Due to https://gitlab.gnome.org/GNOME/gtk/-/issues/1986 we must call popup hide/show if we want to reposition it.
Due to https://gitlab.gnome.org/GNOME/gtk/-/issues/4071 we can't show popup on x < 0 & y < 0 relative coordinates.

As a workaround check popup position and when it's negative, move popup at 0,0, show it and then move back
to original coordinates.

When gdk_window_move_to_rect() is used then set 0,0 coordinates right before the call and leave
gdk_window_move_to_rect() to move the popup.

Differential Revision: https://phabricator.services.mozilla.com/D124032
2021-08-31 13:24:30 +00:00
Robert Mader
6bdde8813f Bug 1712665 - Ensure we reset the EGLSurface on new CompositorWidgetDelegate on X11/EGL, r=stransky
To ensure we don't freeze when the compositing state changes and
makes a similar call in `Create()` redundant.

Note: we can't do this in `OnCompositedChanged()` as it gets called
too early.

Differential Revision: https://phabricator.services.mozilla.com/D123792
2021-08-31 13:10:29 +00:00
Andrew Osmond
2569649469 Bug 1724936 - Remove XRender support. r=jrmuizel
This has been deprecated for a long time, and it doesn't work in
conjuction with WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D122368
2021-08-25 19:35:23 +00:00
Butkovits Atila
0745451aff Backed out changeset f767bc7e5cd8 (bug 1724936) for causing build bustages on nsLookAndFeel.cpp. CLOSED TREE 2021-08-25 21:21:59 +03:00
Andrew Osmond
d428f646cc Bug 1724936 - Remove XRender support. r=jrmuizel
This has been deprecated for a long time, and it doesn't work in
conjuction with WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D122368
2021-08-25 17:45:04 +00:00
Jeff Muizelaar
39b48cfe0c Bug 1727395 - Remove unused ClientLayerManager.h includes. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D123518
2021-08-24 19:27:26 +00:00
Emilio Cobos Álvarez
17d8c6da30 Bug 1725604 - Drive-by cleanups. r=stransky
Depends on D122584

Differential Revision: https://phabricator.services.mozilla.com/D122610
2021-08-23 12:10:43 +00:00
Emilio Cobos Álvarez
a650eedff7 Bug 1725604 - Set input shape region in top-level window. r=stransky
This works, but there's an issue dealing with dynamic changes. I'm
almost sure that's a GTK issue, will try to file and repro.

Differential Revision: https://phabricator.services.mozilla.com/D122584
2021-08-23 12:10:43 +00:00
Eitan Isaacson
3cd71917be Bug 1725519 - Build nsWindow::GetFocusedWindow in non-Wayland configs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122646
2021-08-16 07:13:48 +00:00
hmh
f24a15003b Bug 1725496 - Remove obsolete GTK/X11 event compression. r=stransky,emilio
According to the GTK/GDK docs:
https://docs.gtk.org/gdk3/method.Window.set_event_compression.html event
compression is enabled by default and there is no need to manually remove
motion events anymore.

Differential Revision: https://phabricator.services.mozilla.com/D122534
2021-08-13 09:52:53 +00:00
stransky
17a1e02263 Bug 1720551 [Wayland] Update popup anchor for RTL locales, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122333
2021-08-12 14:07:30 +00:00
Iulian Moraru
e1bf7628ce Backed out changeset 8b346c50a44c (bug 1720551) for causing bc failures on browser_test_clipboardcache.js. CLOSED TREE 2021-08-12 19:24:16 +03:00
stransky
b5d2999671 Bug 1720551 [Wayland] Update popup anchor for RTL locales, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122333
2021-08-12 14:07:30 +00:00
Robert Mader
e080286d4f Bug 1725371 - Reenable Gnome subsurface workaround,
This workaround was removed in D121650. Unfortunately we need it
a bit longer until the Mutter fix reaches users, as triggering it
crashes the whole desktop.

Differential Revision: https://phabricator.services.mozilla.com/D122460
2021-08-12 12:38:48 +00:00
stransky
871a520988 Bug 1725126 [Linux] Build PopupAlignmentToGdkGravity(), r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122331
2021-08-11 19:17:26 +00:00
stransky
abf5182caf Bug 1722450 [Wayland] Pause compositor when screen scale changes and content is not updated yet, r=sotaro
We need to track window compositor state in various cases, when compositor is paused after window creation,
when compositor is paused for hidden window (EGLSurface is missing) and paused compositor when layout is not updated yet
and drawing will lead to incorrect / obsoleted window content.

In this patch we track compositor state by WindowCompositorState atomic enum (because it can be accessed from Compositor thread)
and two private methods (PauseCompositorHiddenWindow and ResumeCompositorHiddenWindow) and two public ones (PauseCompositor() and ResumeCompositor).

Private interface is used by nsWindow when EGLSurface is missing so we can't render to window - it's initial compositor pause and
pause when window is hidden.

Public interface is used by nsWindow and WebRender compositor to disable/enable rendering when window content is updated.
When compositor is disabled by public interface it will be enabled automatically after a timeout (1s) or when content layout is updated.

Changes in the patch:

- Implement GtkCompositorWidget::RemoteLayoutSizeUpdated() to notify GtkCompositorWidget widget about layout size update in content process.
- Track nsWindow compositor state by WindowCompositorState
- Implement nsWindow::PauseCompositorHiddenWindow() and ResumeCompositorHiddenWindow() to handle internal nsWindow states.
- Implement nsWindow::PauseCompositor() and nsWindow::ResumeCompositor() to allow compositor pause/resume during content layout updates.
- Use timeout to resume compositor paused by public interface as a fallback when content is not updated or it takes too long.

Differential Revision: https://phabricator.services.mozilla.com/D121650
2021-08-11 07:48:53 +00:00
stransky
5ecd247888 Bug 1722450 [Wayland] Reduce window changes during scale changes, r=rmader
- Set mozcontainer scale only when we're going to paint into it.
- Set scale to EGL window with window size update at nsWindow::SetEGLNativeWindowSize().
- Don't fire configure events for scale changes as we handle scale change by OnScaleChanged().
- Remove redundant layout updates from nsWindow::OnScaleChanged().
- Dont pass allocation size to OnScaleChanged() as it's not provided by the Gtk signal.
- Log updates

Differential Revision: https://phabricator.services.mozilla.com/D121649
2021-08-11 07:48:52 +00:00
stransky
0cd595c18d Bug 1724679 [Linux] Check env variables for '1' to enable them, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D122076
2021-08-11 07:28:57 +00:00
stransky
ca50da791a Bug 1718727 [Wayland] Don't constrain popup size by screen size on Wayland, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122102
2021-08-11 06:37:07 +00:00
Timothy Nikkel
33345a9afb Bug 1678771. Rename TouchpadPinchPhase to TouchpadGesturePhase. r=hiro
So we can use it for sending pan gestures too.

Depends on D114358

Differential Revision: https://phabricator.services.mozilla.com/D122048
2021-08-08 22:04:17 +00:00
stransky
8ff1545a38 Bug 1722876 [Wayland] Remove 'closed' flags when popup is opened again, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D121726
2021-08-05 09:20:44 +00:00
Matt Woodrow
d4e496f271 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120920
2021-08-05 06:48:34 +00:00
Csoregi Natalia
4bee9e525f Backed out 3 changesets (bug 1722258) for causing Bug 1722935. a=backout
Backed out changeset cf8a1175abd1 (bug 1722258)
Backed out changeset 41176d476eb7 (bug 1722258)
Backed out changeset 4149d596d03d (bug 1722258)
2021-07-29 20:19:48 +03:00
Matt Woodrow
5436ad0e68 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120920
2021-07-28 20:58:22 +00:00
Matt Woodrow
8964031845 Bug 1721537 - Split out WindowRenderer base class from LayerManager. r=miko
Depends on D120439

Differential Revision: https://phabricator.services.mozilla.com/D120440
2021-07-22 22:58:57 +00:00
Matt Woodrow
4df1e6d64a Bug 1721537 - Simplify nsIWidget::GetLayerManager by removing unused parameters. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120439
2021-07-22 22:58:57 +00:00
Robert Mader
ddf339784c Bug 1721298 - Reenable unconditional pausing of WR in compositor mode, r=stransky
At as temporary measure to fix popups in compositor mode until some
fixes landed in FF and Mutter.

Differential Revision: https://phabricator.services.mozilla.com/D120300
2021-07-21 20:09:01 +00:00
stransky
eb83c70f2f Bug 1718507 [Wayland] Implement nsWindow::GetWidgetScreen() by ScreenGetter on Wayland, r=jhorak
- Move screen getter initialization to ScreenGetterGtk::Init() to initialize it after a global object is created.
- Store screen list internally at ScreenGetterWayland to allow searching in it.
- Implement ScreenGetterWayland::GetMonitorForWindow() to get monitor/wl_output for nsWindow.
- Implement ScreenGetterWayland::GetScreenForWindow() to get screen where the window is placed.
- Implement ScreenGetterWayland::GetScreenRectForWindow() to get window screen rect.
- Do some more logging on ScreenHelperGTK.cpp

Differential Revision: https://phabricator.services.mozilla.com/D120056
2021-07-20 18:18:31 +00:00
stransky
ceec836493 Bug 1717476 [Wayland] Change nsWaylandDragContext to RefPtr<DataOffer> in nsWindow code, r=jhorak
Depends on D118577

Differential Revision: https://phabricator.services.mozilla.com/D118578
2021-07-20 10:53:31 +00:00
stransky
227ddf3dd2 Bug 1717451 [Wayland] Pause compositor only on accelerated backends, r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D119963
2021-07-19 07:14:17 +00:00
stransky
38610781c0 Bug 1717451 [Wayland] Disable remote rendering to closed popups, r=sotaro
When we close popup window we also pause compositor as EGL surface is deleted and we can't paint into it.

Paused compositor leads to pending WebRender transactions at nsRefreshDriver which has a bit though limit here and when we hit it
nsRefreshDriver stops to issue rendering event for all windows.

To avoid that when a window is hidden and compositor paused also clear pending WebRender transactions.

Differential Revision: https://phabricator.services.mozilla.com/D119962
2021-07-19 07:14:02 +00:00
Amir M. Saeid
e9dbc93988 Bug 1720694 - Set mGtkWindowRoleName so WM_WINDOW_ROLE can be set properly. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D120000
2021-07-16 07:59:59 +00:00
stransky
75d6626222 Bug 1718507 [Wayland] Don't scale screen sizes at nsWindow::GetScreenRect(), r=jhorak
Don't scale screen values at nsWindow::GetScreenRect() as it should report screen sizes "unscaled".

Differential Revision: https://phabricator.services.mozilla.com/D118957
2021-07-15 13:56:45 +00:00
stransky
66f8b9ab67 Bug 1717451 [Linux] Guard logging code with MOZ_LOG_TEST macro, r=jhorak
Depends on D119030

Differential Revision: https://phabricator.services.mozilla.com/D119031
2021-07-15 09:48:03 +00:00
stransky
a90cb6ea38 Bug 1717451 [Wayland] Validate popup positions before we show them, r=jhorak
- Check correct tooltip position and removes it when the position is wrong. This is a workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/4071
- When hidding popup window, mark it as closed when we don't do temporary hide.
- Hide only really visible widgets.
- Don't show closed popups at nsWindow::NativeShow().
- Set startup time only for really shown popups.
- Don't clear mozcontainer callbacks for unmapped mozcontainer.
- Lock mozcontainer at WindowSurfaceWayland::FlushPendingCommits().

Depends on D119029

Differential Revision: https://phabricator.services.mozilla.com/D119030
2021-07-15 09:48:03 +00:00
stransky
ffa9a1b828 Bug 1717451 [Wayland] Rename WaylandPopupHierarchyMarkByLayout to WaylandPopupHierarchyValidateByLayout r=jhorak
Depends on D119028

Differential Revision: https://phabricator.services.mozilla.com/D119029
2021-07-15 09:48:03 +00:00
stransky
6442ac1e01 Bug 1717451 [Wayland] Add more logging to popup code, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D119027
2021-07-15 09:48:02 +00:00
Robert Mader
a9e69b3615 Bug 1717816 - Only use GLX version of findFisual() on EGL on mesa,r=stransky
Mesa allows mixing GLX and EGL contexts, while e.g. Nvidia doesn't.
So similar to D92466, only use GLX features on mesa.

Nvidia needs another fix on top of that to actually show content,
see D118304

Differential Revision: https://phabricator.services.mozilla.com/D118492
2021-06-24 10:28:52 +00:00
stransky
1c5847dd88 Bug 1716796 [Wayland] Poll mozcontainer remap state, r=rmader
- Poll mozcontainer remap state by moz_container_wayland_remapped()
- Remove WindowSurface::Reset()
- Remove moz_container_wayland_set_window_surface() as it adds extra ref at WindowSurface() and causes cyclic dependency.

Differential Revision: https://phabricator.services.mozilla.com/D118272
2021-06-19 09:33:19 +00:00
stransky
e1cfd0d260 Bug 1716129 [Linux/X11] Reposition GtkWindow when it's shown, r=jhorak
Gtk on X11 tends to ignore widget position change requests when widget is not shown. Save the position requests when window is hidden and
apply that when it's shown.

Differential Revision: https://phabricator.services.mozilla.com/D118260
2021-06-18 18:18:05 +00:00
stransky
bb5e3edd4f Bug 1508608 [Linux] Check for Rollup events at nsWindow::OnTouchEvent/GDK_TOUCH_BEGIN, r=botond
Differential Revision: https://phabricator.services.mozilla.com/D118081
2021-06-17 05:33:25 +00:00
Thomas Wisniewski
58d37f2f7f Bug 1716842 - add back some MOZ_WAYLAND ifdefs which were removed in D117283 so that X11-only builds continue to work; r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D118097
2021-06-17 05:32:51 +00:00
stransky
762891d36a Bug 1715292 [Wayland] Update popup visibility and hierarchy handling, r=jhorak
- Don't remove popup from widget hierarchy on nsWindow::Destroy() but leave nsWindow::Show(false) do the job.
- Don't check popup widget visibility from Gtk as it's not reliable.

Differential Revision: https://phabricator.services.mozilla.com/D117601
2021-06-15 06:10:21 +00:00
stransky
6c3488d0e6 Bug 1661516 [Wayland] Don't use context menu shift in nsMenuPopupFrame::SetPopupPosition(), r=jhorak
- Clear mAdjustOffsetForContextMenu at nsMenuPopupFrame when running on Wayland and use move-to-rect to produce the offset.
- Implement nsWindow::WaylandPopupIsContextMenu()
- Use mBonuds directly in NativeMoveResizeWaylandPopupCallback() instead of Gtk query.
- Add some more loggin and code polishing.

Differential Revision: https://phabricator.services.mozilla.com/D117283
2021-06-14 18:01:04 +00:00
Butkovits Atila
b14687b08f Backed out changeset 27149a6f3ca9 (bug 1661516) for causing build bustages on nsMenuPopupFrame.cpp. CLOSED TREE 2021-06-14 17:59:09 +03:00
stransky
85e1a349ac Bug 1661516 [Wayland] Don't use context menu shift in nsMenuPopupFrame::SetPopupPosition(), r=jhorak
- Clear mAdjustOffsetForContextMenu at nsMenuPopupFrame when running on Wayland and use move-to-rect to produce the offset.
- Implement nsWindow::WaylandPopupIsContextMenu()
- Use mBonuds directly in NativeMoveResizeWaylandPopupCallback() instead of Gtk query.
- Add some more loggin and code polishing.

Differential Revision: https://phabricator.services.mozilla.com/D117283
2021-06-14 14:32:09 +00:00
Robert Mader
70d2a535aa Bug 1711244 - Integrate NativeLayerWayland with WaylandVsyncSource, r=stransky,gfx-reviewers,jrmuizel
Make the vsync source request frame callbacks from opaque native
layers. This is necessary as opaque layers may occlude the
MozContainer surface, which is normally used for frame callbacks.
Wayland compositors may (and are encouraged to) optimize away
such callbacks, so we need to make sure to request frame callbacks
from actually visible surfaces.

Callbacks are requested for all layers, but only the first callback
will trigger the vsync source.
In order to get this right concerning multiple requested callbacks,
possibly being called from different threads etc., introduce a
callback abstraction, `CallbackMultiplexHelper`, to make this simple
to handle for callers.

Differential Revision: https://phabricator.services.mozilla.com/D116026
2021-06-10 15:12:54 +00:00
Filip Hejsek
084e8cbffb Bug 1672591 - Convert workarea to device pixels in GetScreenRect. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D117245
2021-06-10 12:46:08 +00:00
stransky
0293a3dfec Bug 1715477 [Wayland] Update popup hierarchy when we close popup, r=jhorak
- Split WaylandPopupHierarchyUpdateByLayout() to WaylandPopupHierarchyHideByLayout() and WaylandPopupHierarchyMarkByLayout().
  When a popup is closed we need to mark ective popups again which is done by WaylandPopupHierarchyMarkByLayout().

- Allow move-to-rect poupup positioning only when it matches layout and is anchored or it's the first popup attached to toplevel.

Differential Revision: https://phabricator.services.mozilla.com/D117271
2021-06-09 11:42:38 +00:00
Kartikaya Gupta
d3b7940e06 Bug 1714884 - Have the Rollup method take a strongly-typed int point. r=emilio
Depends on D116948

Differential Revision: https://phabricator.services.mozilla.com/D116949
2021-06-07 01:01:10 +00:00