Commit Graph

1096 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a248f1510d Bug 1737044 - Include pointer and frame in nsWindow logging. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D129160
2021-10-21 14:02:30 +00:00
stransky
c13307ce74 Bug 1735095 [Wayland] When font/text scale factor is used, don't reposition popups for +-1 pixel moves, r=jhorak
When font scale is used, move-to-rect popup positiong may end up in endless loop due to rounding error while
popup position oscilates around layout position.

We don't have a fox for that so let's disable such small popup movements when font scale is used.

Depends on D129153

Differential Revision: https://phabricator.services.mozilla.com/D129154
2021-10-21 13:15:02 +00:00
stransky
bc02730150 Bug 1735095 [Wayland] Polish cursorOffset logging, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D129153
2021-10-21 13:15:02 +00:00
Emilio Cobos Álvarez
ea55bf65b0 Bug 1736518 - Remove GTK_CSD_DECORATION_UNKNOWN. r=stransky
Clean up the check while at it.

Differential Revision: https://phabricator.services.mozilla.com/D129006
2021-10-21 09:07:14 +00:00
Emilio Cobos Álvarez
d37eb95bc7 Bug 1736518 - Make browser.tabs.drawInTitlebar a tri-state. r=stransky,Gijs
To more properly support Linux having a different default at runtime.

Expose the resolved value in appinfo for convenience, and use it in the
front-end as needed.

Differential Revision: https://phabricator.services.mozilla.com/D129004
2021-10-21 09:07:12 +00:00
stransky
30383ed419 Bug 1736795 [Linux] Use fixed height of titlebar transparent area r=emilio
Use fixed titlebar height at nsWindow::GetTitlebarRect(). It's used by SW-WR only and to get transparent area of titlebar.
In such limited use case it isn't worth implementing multi-thread getter for it.

Depends on D128993

Differential Revision: https://phabricator.services.mozilla.com/D128994
2021-10-20 18:01:03 +00:00
stransky
ba2afe8f45 Bug 1736795 [Linux] Export titlebar radius as int from LookAndFeel, r=emilio
Titlebar radius is exported as integer from Gtk so there's no need to use floats here.

Differential Revision: https://phabricator.services.mozilla.com/D128993
2021-10-20 18:01:02 +00:00
stransky
c69e8bfac2 Bug 1736523 [Linux] Get inner window for D&D operations r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128920
2021-10-20 08:09:03 +00:00
Emilio Cobos Álvarez
d9c5d0dffa Bug 1736441 - Remove a bunch of dead plugins code from widget/. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D128863
2021-10-19 11:19:13 +00:00
Marian-Vasile Laza
679ab5cf5d Backed out changeset 115b43608ec1 (bug 1736441) for causing build bustages on nsWindow.cpp. CLOSED TREE 2021-10-19 13:54:23 +03:00
Emilio Cobos Álvarez
bcd3c3815e Bug 1736441 - Remove a bunch of dead plugins code from widget/. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D128863
2021-10-19 10:06:50 +00:00
Emilio Cobos Álvarez
dd69f05c22 Bug 1509931 - Use a more precise toolbar radius. r=stransky
This seemed possible/maybe worth doing, but let me know if you'd rather
keep the 10 hard-coded.

Differential Revision: https://phabricator.services.mozilla.com/D128686
2021-10-18 18:51:41 +00:00
stransky
aafe8b11ca Bug 1736377 [Linux] Remove mIsTopLevel as it's always true, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128749
2021-10-18 18:43:30 +00:00
stransky
3a39b03753 Bug 1736377 [Linux] Remove eWindowType_child leftovers, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128747
2021-10-18 18:43:30 +00:00
Emilio Cobos Álvarez
95ecf8f7a6 Bug 1509931 - Expose titlebar radius as a chrome-only CSS environment variable. r=stransky
Mostly plumbing.

Differential Revision: https://phabricator.services.mozilla.com/D128680
2021-10-18 16:22:13 +00:00
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