Commit Graph

1081 Commits

Author SHA1 Message Date
stransky
f25a89e078 Bug 1736068 [Linux] Switch eWindowType_child to eWindowType_popup r=emilio
eWindowType_child type is outdated on Linux and should not be used. It uses widget hierarchy based on GdkWindow and has its limitations.
Let's use popup types instead with proper config and widget hierarchy.

Differential Revision: https://phabricator.services.mozilla.com/D128623
2021-10-16 18:56:34 +00:00
Robert Mader
fa220b5c86 Bug 1735909 - Revert "Bug 1731125", r=stransky
Now that transparency is properly supported on Nvidia, remove
the workaround for non-transparent popups again.

Depends on D128411

Differential Revision: https://phabricator.services.mozilla.com/D128540
2021-10-16 07:45:13 +00:00
Robert Mader
3454cf15f4 Bug 1702546 - Make sure to request EGL configs with matching alpha visual, r=stransky
`GLContextEGL::FindVisual()` currently does not work correctly for
multiple reasons. This patch:
 - fixes transparency issues on Nvidia
 - fixes occasional `EGL_BAD_MATCH` errors on Nvidia
 - allows fixed Mesa (#149) to also use `GLContextEGL::FindVisual()`,
   falling back to `GLContextGLX::FindVisual()` on older versions.
 - does some cleanups that are now possible

Some context:
 - When using EGL we essentially always want visuals with alpha
   nowadays as we do not implement Xshape in HW Webrender. This also
   matches what we do on Wayland and the performance cost is negligible
   as we use opaque regions on toplevel windows.
 - When using `RenderCompositorEGL` we create a global EGL context
   before creating windows. Some drivers (Mesa) are very liberal about
   EGL configs matching visuals, but others (Nvidia) require exact
   matches.
 - Nvidia places EGL configs with non-alpha visuals first, so the
   current code always chooses a config for the global context that,
   when calling `GLContextEGL::FindVisual()` later, results in a
   non-transparent window.
 - Mesa will behave similar once fixed. Currently it does not offer any
   visuals with alpha.

In this patch we make sure to always pick EGL configs that have a
matching visual, i.e. one with alpha if alpha is requested for the
config.
In practice we thus always pick 32bit RGBA8888 configs and visuals.

For Mesa, where currently no such configs are provided, we continue to
provide a fallback config and use GLX to pick some visual with alpha.
This is what we already do right now and what appears to work well.
Once the fix is available, we stop using the fallback code
automatically.

Note: in theory `GLContextEGL::FindVisual()` IMO should not call
`CreateConfig()`, but rather take an existing config or context in
and then just provide the matching visual. This, however, would require
significant work with little benefit. The calls to `CreateConfig()`
should always provide the same and thus matching results.

Differential Revision: https://phabricator.services.mozilla.com/D128411
2021-10-16 07:34:41 +00:00
stransky
f1b55e9bc4 Bug 1735151 [Linux] Don't resize window when we request move only, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128505
2021-10-15 05:43:46 +00:00
stransky
594387f8b3 Bug 1735716 [Linux] remove useless logging r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128447
2021-10-14 19:23:13 +00:00
stransky
33a491c974 Bug 1735867 [Linux] Add logging of workspace management code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128502
2021-10-14 19:20:06 +00:00
stransky
233796939f Bug 1735348 [Linux] Don't check D&D status by mScheduledTask as it's misleading, r=emilio
mScheduledTask means scheduled task. When there's nothing sheduled we look inactive but that's not correct.
Let's remove that check as it was before.

Differential Revision: https://phabricator.services.mozilla.com/D128488
2021-10-14 15:59:43 +00:00
stransky
5f46e64ffe Bug 1735294 [Wayland] Don't use global popup position for tooltips and use move-to-rect when possible, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128202
2021-10-13 08:06:43 +00:00
Emilio Cobos Álvarez
9a2e747f74 Bug 1735369 - Minor formatting clean-ups.
MANUAL PUSH: clang-format fix CLOSED TREE DONTBUILD
2021-10-12 22:05:48 +02:00
Emilio Cobos Álvarez
64288becfd Bug 1735369 - Improve GTK widget logging. r=rmader
This makes it easier to tweak logs by e.g. prepending strings as needed,
and is also less ugly over all.

Also added a few missing includes to fix non-unified builds while at it.

Differential Revision: https://phabricator.services.mozilla.com/D128264
2021-10-12 16:53:42 +00:00
stransky
7daf46d7d1 Bug 1735294 [Wayland] Don't move wayland popups at nsWindow::Create() r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128189
2021-10-12 13:06:35 +00:00
stransky
e444756de7 Bug 1735277 [Wayland] Clear saved mNewBoundsAfterMoveToRect when new resize is requested, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128161
2021-10-12 13:05:46 +00:00
stransky
901be8cf9e Bug 1735277 [Wayland] Polish window bound coordinates calculation at move-to-rect callback, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128160
2021-10-12 13:05:31 +00:00
criss
855c46be93 Backed out changeset da5a7c4478d9 (bug 1727815) for causing assertion failures on nsGlobalWindowOuter.cpp. CLOSED TREE 2021-10-12 12:45:26 +03:00
Alexander Taylor
83430de34e Bug 1727815 Toggle internal fullscreen even if window widget fullscreen not achieved r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D123830
2021-10-12 07:57:48 +00:00
stransky
fce837912a Bug 1734368 [Wayland] Use async FlushRendering on Wayland, r=sotaro
Synced FlushRendering() causes deadlock on Wayland.
Main thread is blocked at MessageChannel::WaitForSyncNotify() and it's not processing events from system.
Rendering thread is blocked at RendererOGL::UpdateAndRender() / eglQuerySurface(). Mesa is waiting for free back buffer
at get_back_bo(), it's spinning wl_display_roundtrip_queue() and waiting for free buffer but it doesn't get one as main loop is blocked.

Differential Revision: https://phabricator.services.mozilla.com/D127878
2021-10-09 15:26:49 +00:00
stransky
d192f85a4a Bug 1733620 [Linux] Don't call move/resize when we're waiting to move-to-rect callback, r=jhorak
Right now we resize/move popup windows even when move-to-rect callback is pending which leads to wrong popup
position / size if popup is moved/resized repeatedly.

In this patch we do:
- Remove multiple move/resize internal routines (NativeMove(), NativeResize()) and use only one method NativeMoveResize() for both.
- Always use NativeMoveResizeWaylandPopup() for popup window positioning and check if we're waiting to move-to-rect callback.
- When we're waiting to the callback save both new size and position (previously we saved size only) and use mBounds coordinates for it.
- Remove position/size params from NativeMoveResize() / NativeMoveResizeWaylandPopup() and use mBounds internally and mBounds is already
  set and it's correct popup size/position.
- Remove extra DispatchResized() call - it's already called from NativeMoveResize().

Differential Revision: https://phabricator.services.mozilla.com/D127662
2021-10-07 08:08:01 +00:00
Robert Mader
67dd516662 Bug 1733094 - Assume UseWebRender for FindVisual, r=stransky,emilio
`gfxVars::UseWebRender()` now always returns `true`, thus stop passing
it around as argument. And as HW-WR unconditionally requires an alpha
channel, remove that from the code as well.

While on it, also stop requesting a depth buffer. It's not needed any
more after D113532 and D115216.

Finally, some small drive-by cleanups.

Differential Revision: https://phabricator.services.mozilla.com/D126922
2021-10-06 11:30:37 +00:00
Nicolas Silva
8edf9638bf Bug 1690619 - Keep track of where the request to rendering something comes from. r=gfx-reviewers,mstange
This patch adds plumbing to keep track of why we request frames to be rendered.
This information is then displayed in gecko profile markers on the renderer thread as well as in profiler HUD counters (See "Render reasons" in profiler.rs).

Differential Revision: https://phabricator.services.mozilla.com/D127274
2021-10-05 12:54:39 +00:00
stransky
227aa3b04a Bug 1733754 [Wayland] Use global popup coordinates when its not shown, r=jhorak
A workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/4308

Differential Revision: https://phabricator.services.mozilla.com/D127425
2021-10-05 08:55:01 +00:00
Cristian Tuns
c8657aa597 Backed out changeset 94ec92a5e99f (bug 1733094) for causing mochitest failures on test_drawWindow_widget_layers.html. CLOSED TREE 2021-10-04 19:45:34 -04:00
Robert Mader
1d33852eaf Bug 1733094 - Assume UseWebRender for FindVisual, r=stransky,emilio
`gfxVars::UseWebRender()` now always returns `true` thus stop passing
it around as argument.

At the same time, WR does not require a depth buffer any more, thus
stop requesting it when choosing a matching XVisual.

While on it, also stop requesting an alpha channel were it shouldn't
be needed. This point will require some regression testing, making
this patch 95 material.

Differential Revision: https://phabricator.services.mozilla.com/D126922
2021-10-04 20:28:24 +00:00
Robert Mader
7976218ea9 Bug 1730822 - Disable HW-WR for child windows on X11/EGL,
Currently child windows do not show up in this configuration and it's
not clear yet what the root cause of the issue is.
As we want to ship X11/EGL by default in 94, work around the issue
for now.

Differential Revision: https://phabricator.services.mozilla.com/D127264
2021-10-01 13:26:10 +00:00
stransky
4f33fc7ce2 Bug 1731125 [Linux/EGL] Render popups by SW-WR on X11/EGL due to missing transparency, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D126823
2021-09-28 18:56:38 +00:00
stransky
6f63e14be8 Bug 1730203 [Wayland] Reply to drag_motion from Gtk handler, r=emilio
Wayland/Gtk sets drag state right after drag_motion event only.

While we're reading data for child process we're getting 'drag_motion' events from nested loop.
We don't know the final D&D state yet as we need reply from the child process.
When we set the D&D state latter, it's ignored by Gtk and D&D is considered as
canceled by client.

Right now we explicitly state 'drag denied' after D&D start until we have a reply from child process.
We're changing it to 'drag accepted' on Wayland until we have a reply from child process
and we also send the reply in WindowDragMotionHandler() to fulfill Wayland protocol needs.

It does not change final D&D state - we get the data only when child process requests it.

Differential Revision: https://phabricator.services.mozilla.com/D126226
2021-09-24 08:02:16 +00:00
Csoregi Natalia
df5b1f578f Backed out 2 changesets (bug 1730203, bug 1731197) for drag and drop of tabs causing duplicates (bug 1732116). a=backout
Backed out changeset 11250511cdb8 (bug 1730203)
Backed out changeset f213f078a6d2 (bug 1731197)
2021-09-23 17:47:22 +03:00
stransky
f22e091b25 Bug 1730203 [Wayland] Reply to drag_motion from Gtk handler, r=emilio
Wayland/Gtk sets drag state right after drag_motion event only.

While we're reading data for child process we're getting 'drag_motion' events from nested loop.
We don't know the final D&D state yet as we need reply from the child process.
When we set the D&D state latter, it's ignored by Gtk and D&D is considered as
canceled by client.

Right now we explicitly state 'drag denied' after D&D start until we have a reply from child process.
We're changing it to 'drag accepted' on Wayland until we have a reply from child process
and we also send the reply in WindowDragMotionHandler() to fulfill Wayland protocol needs.

It does not change final D&D state - we get the data only when child process requests it.

Differential Revision: https://phabricator.services.mozilla.com/D126226
2021-09-22 11:30:15 +00:00
Cosmin Sabou
1ad650ad4a Backed out changeset b0abd344cf28 (bug 1730203) for causing linux bustages on nsWindow.cpp. CLOSED TREE 2021-09-21 18:56:14 +03:00
stransky
c23dacf14c Bug 1730203 [Linux] Call WindowDragMotionHandler() from nsWindow::OnDragDataReceivedEvent, r=emilio
When we get data from D&D operation by nsWindow::OnDragDataReceivedEvent, speed up data transfer to child process by
WindowDragMotionHandler() call.

Differential Revision: https://phabricator.services.mozilla.com/D126211
2021-09-21 13:42:25 +00:00
stransky
dcadf2b1b3 Bug 1731737 [Linux] Call nsDragService::RunScheduledTask() event handler faster and disable its re-entrance r=emilio
We sometimes miss reply to D&D motion event due to delayed DnsDragService::RunScheduledTask() call.
We can't call D&D handler directly from drag-motion event as it causes nested recursions and re-entrance
in glib loop so use higher priority for the delayed handler call at least.

Disable re-entrance of nsDragService::RunScheduledTask() which may happen when
we get D&D data from drag_drop event.

Provide more loggig to D&D code.

Differential Revision: https://phabricator.services.mozilla.com/D126182
2021-09-21 13:30:44 +00:00
stransky
503f784f96 Bug 1731155 [Wayland] Check popupFrame at nsWindow::WaylandPopupSetDirectPosition(), r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D126183
2021-09-21 08:53:45 +00:00
stransky
0d564f6aa7 Bug 1730079 [Wayland] Get popup text direction by nsWindow::IsPopupDirectionRTL(), r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D125152
2021-09-10 11:11:20 +00:00
stransky
b8d8f19a18 Bug 1729709 [Wayland] Avoid move-to-rect calls when popup size changes but it still fits main window bounds, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D124914
2021-09-09 10:20:18 +00:00
stransky
e2dc1313b3 Bug 1718867 [Wayland] Move noautohide popup in bounds of parent window, r=emilio
When we position noautohide popup we can't use xdg_positioner as the popup
is rendered aside popup hierarchy and can be closed by user interaction only.

Try to keep the popup on screen by just moving it in scope of
it's parent window.

Differential Revision: https://phabricator.services.mozilla.com/D124909
2021-09-09 04:37:04 +00:00
stransky
21f45bab6f Bug 1729424 [Wayland] Remove WindowSurfaceWayland backend r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D124747
2021-09-07 12:48:23 +00:00
Matt Woodrow
6d44c41723 Bug 1728914 - Remove widget code references to AsLayerManager and access WebRender directly. r=gfx-reviewers,aosmond,jrmuizel
Depends on D124415

Differential Revision: https://phabricator.services.mozilla.com/D124416
2021-09-05 02:16:36 +00:00
stransky
f6564246ac Bug 1727709 [Wayland] Force GdkWindow repaint after gdk_window_input_shape_combine_region() call, r=emilio
On Wayland gdk_window_input_shape_combine_region() call is cached and applied to underlying wl_surface when GdkWindow is repainted.
Force repaint of GdkWindow at nsWindow::SetWindowMouseTransparent() to apply the changes immediately.

Differential Revision: https://phabricator.services.mozilla.com/D124256
2021-09-02 07:21:50 +00:00
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