Commit Graph

861 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
aae08399a8 Bug 1668875 - Distinguish theme changes that can and cannot affect style/layout. r=tnikkel
This should make the optimization landed earlier in this bug apply for
some of the NotifyThemeChanged() calls in nsWindow.cpp which are causing
all the extra invalidations.

If we know that system colors/fonts didn't change, we can avoid doing a
bunch of reflow work and the patch from earlier in the bug can avoid
re-rasterizing images too.

Differential Revision: https://phabricator.services.mozilla.com/D94425
2020-10-27 10:24:40 +00:00
Andrew Osmond
1c89e64020 Bug 1656211 - Force recompositing frames on GTK when popup window configuration changes. r=nical
Similar to bug 1280653, it appears that GLX invalidates the back buffer
while we are drawing. The only indication we get of this are resize and
configure events from X. We suppress the configure event for popups for
various reasons, so this patch explicitly generates a forced recomposite
of the frame. It does it immediately so that most of the time it should
beat the presentation of the buffer and avoid displaying of the bad
frame to the user; popups generally are not complicated and should have
plenty of budget to perform the second composite.

Differential Revision: https://phabricator.services.mozilla.com/D93862
2020-10-19 07:44:59 +00:00
Vincent Bernat
82df466c16 Bug 1554850 - handle fractional DPI change on Linux. r=karlt
On Linux, Firefox is listening on notify::scale-factor to detect DPI
change. However, scale-factor is an int and on the lower-end side of
the DPI scale, some devices are using fractional scale factors encoded
into Xft/DPI setting. Changing from ×1 to ×1.5 scale is therefore
undetected.

The proposed change is two-folds:

 - remove use of a cached sDPI value and rely on GTK being the cache

 - listening on notify::gtk-xft-dpi to trigger a DPI change

What is missing:

 - performance evaluation of not caching sDPI (on a 10s session
   loading 2 pages, there is an "overhead" of 6ms on my setup, nothing
   visible from my point of view)

 - when changing Xft/DPI and scale, the change is done twice, this
   seems harmless

Differential Revision: https://phabricator.services.mozilla.com/D92095
2020-10-13 02:47:27 +00:00
Robert Mader
6966d62674 Bug 1619246 - Only use Wayland Vsync source for toplevels. r=stransky
In order to make it usable again until certain issues around child
widgets have been propperly resolved.

Differential Revision: https://phabricator.services.mozilla.com/D93158
2020-10-12 19:02:31 +00:00
Jan Horak
77ed8cef34 Bug 1669495 Fix wrong tooltips sizes on wayland and hidpi displays;r=stransky
The tooltip width can be real number in the hidpi display setup
or when the font scaling is used. In this case the nsWindow GTK
implementation will cut out the non integer part which leads to
narrowing the tooltip and later overflowing the text which
is in the tooltip to next line. This workaround patch adds
a one pixel to the tooltip frame when the tooltip has real number
width or height.

Differential Revision: https://phabricator.services.mozilla.com/D92620
2020-10-08 08:04:32 +00:00
Jan Horak
40ed87d2b9 Bug 1634404 Fix popup position when layout.css.devPixelsPerPx > 0; r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D92759
2020-10-08 07:50:02 +00:00
Csoregi Natalia
6b9cc56ba9 Backed out changeset d42dc1f995bb (bug 1669275) for gfx crashes. CLOSED TREE 2020-10-08 04:26:03 +03:00
Robert Mader
2756822bd0 Bug 1669275 - [WR/EGL/X11] Use GLX features on mesa. r=stransky
This allows mesa to continue using the existing vsync implementation
and nvidia to use the new EGL xvisual logic.

It is an intermediate solution until the issues are fixed. However,
assuming it will take a while to do so, it's probably worth it.

Differential Revision: https://phabricator.services.mozilla.com/D92466
2020-10-07 21:21:20 +00:00
Sylvestre Ledru
a230f54a86 Bug 1669092 - declare 'hasAnchorRect' only for wayland r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D92347
2020-10-05 08:03:58 +00:00
Robert Mader
9dec5a255b Bug 1667116 - Request to stay unredirected on WR/OGL, too. r=stransky
Until bug 1617002 Firefox would unintendedly not get unredirected on X11
when used with WR and OpenGL as it didn't fullfill the requirements -
not being transparent.

Now that this is fixed, fullscreen unredirection can happen on certain
compositors. For the basic compositor we already explicitely ask to not
get unredirected - do that for all backends.

Also adapt tests accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D92180
2020-10-05 02:19:10 +00:00
Razvan Maries
e4dce0315b Backed out changeset c3362c39bb7b (bug 1667116) for perma failures on browser_startup_syncIPC.js. 2020-10-05 02:04:41 +03:00
Robert Mader
235e00ce34 Bug 1667116 - Request to stay unredirected on WR/OGL, too. r=stransky
Until bug 1617002 Firefox would unintendedly not get unredirected on X11
when used with WR and OpenGL as it didn't fullfill the requirements -
not being transparent.

Now that this is fixed, fullscreen unredirection can happen on certain
compositors. For the basic compositor we already explicitely ask to not
get unredirected - do that for all backends.

Also adapt tests accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D92180
2020-10-04 21:12:52 +00:00
Narcis Beleuzu
5b0c511132 Backed out changeset 3d48fba542df (bug 1667116) for bc failures on browser_startup_syncIPC.js CLOSED TREE 2020-10-03 14:44:35 +03:00
Robert Mader
e0be76ae7f Bug 1667116 - Request to stay unredirected on WR/OGL, too. r=stransky
Until bug 1617002 Firefox would unintendedly not get unredirected on X11
when used with WR and OpenGL as it didn't fullfill the requirements -
not being transparent.

Now that this is fixed, fullscreen unredirection can happen on certain
compositors. For the basic compositor we already explicitely ask to not
get unredirected - do that for all backends.

Differential Revision: https://phabricator.services.mozilla.com/D92180
2020-10-03 05:47:51 +00:00
Narcis Beleuzu
bd1a80c545 Backed out changeset 442928b108aa (bug 1667116) for failures on browser_startup_syncIPC.js . CLOSED TREE 2020-10-03 08:39:38 +03:00
Robert Mader
37b376bfe6 Bug 1667116 - Request to stay unredirected on WR/OGL, too. r=stransky CLOSED TREE
Until bug 1617002 Firefox would unintendedly not get unredirected on X11
when used with WR and OpenGL as it didn't fullfill the requirements -
not being transparent.

Now that this is fixed, fullscreen unredirection can happen on certain
compositors. For the basic compositor we already explicitely ask to not
get unredirected - do that for all backends.

Differential Revision: https://phabricator.services.mozilla.com/D92180
2020-10-02 11:33:06 +00:00
Csoregi Natalia
481a8a1b76 Backed out changeset 2b03ab71a84c (bug 1667116) for failures on browser_startup_syncIPC.js. CLOSED TREE 2020-10-02 21:25:57 +03:00
Robert Mader
51fa67b24d Bug 1667116 - Request to stay unredirected on WR/OGL, too. r=stransky
Until bug 1617002 Firefox would unintendedly not get unredirected on X11
when used with WR and OpenGL as it didn't fullfill the requirements -
not being transparent.

Now that this is fixed, fullscreen unredirection can happen on certain
compositors. For the basic compositor we already explicitely ask to not
get unredirected - do that for all backends.

Differential Revision: https://phabricator.services.mozilla.com/D92180
2020-10-02 11:33:06 +00:00
Jan Horak
437fd1ebb5 Bug 1661192 Don't use popup offset when we don't have anchor rect; r=stransky
Popups like autoscroll does not have anchor rectangle while it has set negative
margin to center the popup under cursor. Adding this offset to the final position
leads recursive repositioning of the popup to upper-left position under Wayland.

On the other hand we have to keep the offset for the popups with given anchor rect
like hamburger menus which use the offset to correctly position their pointing arrow.

Differential Revision: https://phabricator.services.mozilla.com/D92045
2020-10-01 11:35:23 +00:00
Botond Ballo
1074cb3575 Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Simon Giesecke
ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
stransky
e66c0be4f3 Bug 1666176 Don't use gfxPlatformGtk in nsWindow::GetSystemCSDSupportLevel, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D90814
2020-09-21 07:01:22 +00:00
stransky
dcf917b044 Bug 1662834 [Linux] Check mGdkWindow validity on nsWindow::UpdateTitlebarTransparencyBitmap(), r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D90144
2020-09-16 09:48:30 +00:00
stransky
c21913a01f Bug 1664496 [KDE] Disable hidden system titlebar by default on KDE, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D89933
2020-09-14 13:59:46 +00:00
stransky
6f8830f945 Bug 1663003 [Linux/EGL] Use GLX to find X Visual for EGL as a workaround for https://gitlab.freedesktop.org/mesa/mesa/-/issues/149, r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D89721
2020-09-11 10:40:09 +00:00
Narcis Beleuzu
66877de9a6 Backed out 2 changesets (bug 1663003) for bustages on nsWindow.cpp . CLOSED TREE
Backed out changeset 50a87c4ddf15 (bug 1663003)
Backed out changeset c3035ba4d8fc (bug 1663003)
2020-09-10 23:40:09 +03:00
stransky
e9a4451c5c Bug 1663003 [Linux/EGL] Use GLX to find X Visual for EGL as a workaround for https://gitlab.freedesktop.org/mesa/mesa/-/issues/149, r=jgilbert
Depends on D89720

Differential Revision: https://phabricator.services.mozilla.com/D89721
2020-09-10 17:47:29 +00:00
stransky
62f499d429 Bug 1663576 [Linux] Don't use gfxPlatformGtk() at nsWindow::IsMainWindowTransparent(), r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D89417
2020-09-08 11:51:52 +00:00
stransky
84a490180d Bug 1663279 [Linux] Update default titlebar configration, r=jhorak
- Use toplevel transparent window by default.
- Use Client decoration for Deepin desktop.
- Hide system titlebar by default on latest KDE versions.
- Hide system titlebar by default on Gnome/Pantheon.

Differential Revision: https://phabricator.services.mozilla.com/D89363
2020-09-07 11:54:51 +00:00
Emilio Cobos Álvarez
202a671c18 Bug 1659423 - Also move wayland popup if getting sane popup dimensions. r=stransky
What is going on is that nsComboboxControlFrame first positions the 0x0
widget, then sizes it. But when moving a 0x0 wayland popup, we just bail
out in NativeMoveResizeWaylandPopup().

So unless we also change the offset in some other way, and hit this
code:

  https://searchfox.org/mozilla-central/rev/dc30fc92f2d02abe716426df7eff0f0bbb907da2/view/nsView.cpp#335

when updating the view tree (which doesn't happen with the maximized
window, and actually it's a bit questionable that it happens without it,
there may be some pre-existing coordinate space confusion there) we'll
end up in a plain Resize() rather than MoveResize(), and never position
the widget at the right place.

This doesn't happen for regular web content because the new print dialog
lives in the parent process (which uses nsComboboxControlFrame) rather
than on the child (which uses nsMenuPopupFrame).

Differential Revision: https://phabricator.services.mozilla.com/D89320
2020-09-07 08:36:33 +00:00
stransky
f383cc2b07 Bug 1460959 [Linux] Implement nsWindow::IsMainWindowTransparent(), r=jhorak
Implement nsWindow::IsMainWindowTransparent() as we need that info in BasicCompositor.

Depends on D88560

Differential Revision: https://phabricator.services.mozilla.com/D88975
2020-09-03 12:59:02 +00:00
stransky
ff85adb0da Bug 1460959 [Linux] Disable titlebar by default when we can paint the titlebar transparent corners, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D88560
2020-09-03 12:59:10 +00:00
stransky
b0c93be8d6 Bug 1460959 [Linux] Use alpha visual for Firefox toplevel window on composited screens, r=jhorak
In order to hide system titlebar by default we need to use alpha visual for Firefox main window.

Differential Revision: https://phabricator.services.mozilla.com/D88559
2020-09-03 12:59:18 +00:00
stransky
55773633cd Bug 1650583 [Linux/EGL] Use GLContextEGL::FindVisual() in nsWindow::Create to set visual for GdkWindow, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D87637
2020-09-03 09:02:52 +00:00
Noemi Erli
528e870f87 Backed out 4 changesets (bug 1650583) for causing build bustages in rules.mk CLOSED TREE
Backed out changeset 033e491241b1 (bug 1650583)
Backed out changeset e6a03fea3aad (bug 1650583)
Backed out changeset b24be6b2d8cd (bug 1650583)
Backed out changeset bbb04547d367 (bug 1650583)
2020-09-03 02:33:34 +03:00
Martin Stransky
3c49292468 Bug 1650583 [Linux/EGL] Use GLContextEGL::FindVisual() in nsWindow::Create to set visual for GdkWindow, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D87637
2020-09-02 19:45:37 +00:00
Edgar Chen
d81e43a2d8 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-27 17:19:03 +00:00
Cosmin Sabou
1dbc50be82 Backed out 5 changesets (bug 1653949) for assertion failures on EventStateManager.cpp. CLOSED TREE
Backed out changeset ad7c35ab2a40 (bug 1653949)
Backed out changeset 31cb90ef998a (bug 1653949)
Backed out changeset 03e65cbd2a11 (bug 1653949)
Backed out changeset a87ac2a7db70 (bug 1653949)
Backed out changeset 390dd2c04cd4 (bug 1653949)
2020-08-27 20:13:20 +03:00
Edgar Chen
f695af7814 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-26 14:19:46 +00:00
stransky
59ea54107b Bug 1660100 [Linux/Gtk] Add CSD decorations size only to windows without system titlebar, r=jhorak
- Revert Bug 1658885 - use Gtk styles to get CSD sizes.
- Add CSD decoration sizes to titlebar-less windows only.

Differential Revision: https://phabricator.services.mozilla.com/D88139
2020-08-27 08:10:42 +00:00
Martin Stransky
ff995f9d3e Bug 1658885 [Linux] Use window sizes to get window CSD extents, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D86919
2020-08-19 19:13:44 +00:00
Martin Stransky
212755313e Bug 1651748 [Linux] Add CSD decoration size to size constraints, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D86833
2020-08-19 06:14:01 +00:00
Martin Stransky
06a266f0a2 Bug 1628742 [Linux] Provide hiden widget.workspace-management preference as an override to restore windows on particular worspaces, r=jhorak
When user adds and sets widget.workspace-management preference value, use it as override to restore windows on particular worspaces.

Differential Revision: https://phabricator.services.mozilla.com/D86205
2020-08-07 10:29:10 +00:00
Martin Stransky
b612cfc722 Bug 1657315 [Linux] Remove unused X11 display connection from gfxPlatformGtk, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D85993
2020-08-05 10:56:33 +00:00
Nicolas Silva
28e06faa50 Bug 1652743 - Replace Window origin caching with another implementation. r=aosmond
The new implementation is based on traversing the parent window hierarchy and accumulating relative positions. The implementation unfortunately has to be disabled while another issue is investigated.

Differential Revision: https://phabricator.services.mozilla.com/D85278
2020-07-31 12:56:18 +00:00
Robert Mader
b0638f267f Bug 1617002 - Rework GTK opaque region handling. r=stransky
* always update the opaque region if the toplevel window allocation
changes - this fixes opaque regions on X11 with WR and OGL renderers,
as GTK resets the opaque region in this case. The previous solution
was modeled similar to what's done on Windows - we have to follow GTK
though.
 * use `gdk_window_set_opaque_region` also for Wayland - this fixes
occasional glitches where the opaque region was not properly updated.
Let GTK handle that instead, as it has better control of the internals.
 * remove a failed attempt to work around bug 1615098 from
MozContainerWayland
 * repurpose `widget.wayland.use-opaque-region` for subsurface opaque
regions and disable it by default. We want to enable it again eventually
and not all Wayland compositors suffer from bug 1615098
 * some cleanups - some optimizations should not be needed anymore now

Unfortunately this does not cover the classic title bar yet - that will
need to be done in a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D84024
2020-07-30 18:28:42 +00:00
Martin Stransky
fa50d36dd9 Bug 1655266 [Linux] Remove shadowed local variable 'usesDynamicWorkspaces' to correctly return worspace setup, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D84907
2020-07-30 18:11:17 +00:00
Robert Mader
744aa309c1 Bug 1654687 - Disable visibility tracking, r=stransky
It has been deprecated since GTK 3.12 as it can not reliable work on
modern X11 compositors.

On Wayland, the equivalent functionally is part of the core protocol
via frame callbacks.

While on it, mark a call to `gtk_widget_set_double_buffered` explicitly
limited to X11.

Differential Revision: https://phabricator.services.mozilla.com/D84624
2020-07-29 14:05:12 +00:00
Martin Stransky
719b52333e Bug 1645776 [Linux/Gtk] Workspace restore - get window manager name only when XDG_CURRENT_DESKTOP is missing and check/ship widget.disable-workspace-management to disable it, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D84515
2020-07-24 11:59:38 +00:00
Robert Mader
4b2368b826 Bug 1654687 - Use gtk_window_set_titlebar directly, r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D84623
2020-07-23 08:53:40 +00:00