The prefers-reduced-motion settings must be initialized before the value
is requested. If EnsureInit() has not been called before the
prefers-reduced-motion value is evaluated, we may return an unexpected
value of false.
Differential Revision: https://phabricator.services.mozilla.com/D192475
- Create corner resizers larger to perform corner resize more comfortable
- Don't allow to grip West/North edges for resize on Wayland & windows with fixed aspect ratio. We can't resize such windows this way.
Differential Revision: https://phabricator.services.mozilla.com/D191758
We don't need to call gtk_widget_realize() on nsWindow::Create() any more as we know if we use CSD decorations already.
Also use fast-path titlebar setting for unrealized widgets.
Differential Revision: https://phabricator.services.mozilla.com/D191172
Don't autostart org.freedesktop.portal.Desktop by g_dbus_proxy_new_for_bus_sync(), that may block Firefox start for 30~ seconds after desktop start.
Use g_bus_watch_name() and get session data only if org.freedesktop.portal.Desktop is available.
Differential Revision: https://phabricator.services.mozilla.com/D192335
Don't autostart org.freedesktop.portal.Desktop by g_dbus_proxy_new_for_bus_sync(), that may block Firefox start for 30~ seconds after desktop start.
Use g_bus_watch_name() and get session data only if org.freedesktop.portal.Desktop is available.
Differential Revision: https://phabricator.services.mozilla.com/D192335
SIGTERM is supposed to be a standard way how to terminate Linux application. So don't fire emergency exit but run usual exit sequence.
Depends on D191077
Differential Revision: https://phabricator.services.mozilla.com/D191079
Allow to switch to another idle service type if UserIdleServiceMutter::PollIdleTime() fails. We recently see that failures on Mozilla try servers as:
Failed to call GetIdletime(): GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Mutter.IdleMonitor was not provided by any .service files
Differential Revision: https://phabricator.services.mozilla.com/D192208
After bug 1851817, all platforms uses nsBaseClipboard as base class and clipboard
owner is handled there, so nsIClipboardOwner parameter is unused.
Differential Revision: https://phabricator.services.mozilla.com/D190236
Fix a compile error caused by WakeLockListener being used without the
corresponding header due to the header being included only when dbus is
enabled. Since WakeLockListener works without dbus as well, the fix is
to make the inclusion unconditional.
Differential Revision: https://phabricator.services.mozilla.com/D191034
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.
I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).
Differential Revision: https://phabricator.services.mozilla.com/D190450
Recently we use BTN_SIDE (Button 8) to navigate web back, BTN_EXTRA (Button 9) to navigate web forward.
In this patch add BTN_FORWARD (Button 10) to also navigate web forward.
Differential Revision: https://phabricator.services.mozilla.com/D190153
This patch fixes `nsWindow::RefreshWindowClass` to call `gdk_wayland_window_set_application_id` to set the application ID (or window class in x11 terminology) when using Wayland. The application ID is set to the value of the `windowclass` attribute if that attribute exists. When the attribute does not exist, the function is not called to keep the default application ID.
Additionally, `nsWindow::Show` has been updated to call `nsWindow::RefreshWindowClass` after the window is shown. This is needed as `gdk_wayland_window_set_application_id` does not work before the window is displayed, and all existing calls to `nsWindow::RefreshWindowClass` happened before the window was shown.
Differential Revision: https://phabricator.services.mozilla.com/D189062
This makes non-native background rendering a bit nicer in themes like
Adwaita-dark or Yaru-dark, and in general should be more correct, since
that's how backgrounds are drawn (image over color).
Differential Revision: https://phabricator.services.mozilla.com/D188774
Folder selection is only possible in newer versions of xdg-desktop-portal, so
we implement isModeSupported so that we can check for this capability at runtime.
Differential Revision: https://phabricator.services.mozilla.com/D188359
Folder selection is only possible in newer versions of xdg-desktop-portal, so
we implement isModeSupported so that we can check for this capability at runtime.
Differential Revision: https://phabricator.services.mozilla.com/D188359
Propagate return code from nsWindow::SetEGLNativeWindowSize() to WebRender/OGL compositors.
It allows to skip rendering in case of incompatible recent EGL buffer size.
Depends on D187889
Differential Revision: https://phabricator.services.mozilla.com/D187890
If screen scale doesn't match requested EGLWindow size, doesn't adjust requested EGLWindow size but rather fail and report it back.
We can't update EGLWindow size imediatelly as EGL surface buffers are already created and wl_egl_window_resize() is effective for next rendering cycle,
so recent rendering will use old and incompatible screen size.
Differential Revision: https://phabricator.services.mozilla.com/D187889
This is an edge case where layout thinks the popup doesn't need
flipping, but the compositor does.
In an ideal world we'd convince the compositor it doesn't by providing
our margins, but that doesn't seem easily doable.
So check whether there was a constraint rect that we tried to honor
instead, rather than whether we actually had to flip or what not.
Differential Revision: https://phabricator.services.mozilla.com/D187823
This is the default on macOS (implemented at the system level somehow,
apparently?), and Windows (bug 1757463).
After a quick look, most "native" editing applications on Linux support
this. Quick ones I tested:
* Gedit, gtk4-demo (while hovering over the editable area)
* Kate, Konsole, KWrite
LibreOffice does not, ironically.
Anyways, I think this is worth trying? Leave a pref for ease of turning
it off just in case.
Differential Revision: https://phabricator.services.mozilla.com/D187827
Bug 311340 tried to fix a similar issue, but have to clear clipboard in nsClipboard's
destructor in order to avoid crash while calling gdk_display_close() on exit,
see bug 531580. But after bug 1626536, we are no longer calling gdk_display_close()
on exit, I don't see the same crash as bug 531580 anymore, either.
Differential Revision: https://phabricator.services.mozilla.com/D187595
Bug 1843700 is basically a dupe of the bug that caused us to disable it.
Will look to enable it on wayland separately if we can.
Depends on D186126
Differential Revision: https://phabricator.services.mozilla.com/D186127
The implementation is uglier than it needs to be. We basically need to
override the GTK styles for the window decorations with the desired
radius.
This is because of two reasons:
* Adwaita on gtk3 doesn't provide a bottom corner radius.
* Even if it did we couldn't reasonably query it, see comment 4.
So in order for stuff to look sensible we need to make sure that we and
GTK agree on what radius to use. Using the titlebar radius makes sense
here.
Differential Revision: https://phabricator.services.mozilla.com/D187343
If you have something like Adwaita-dark, switching prefers-dark-theme is
useless. Try to first find a named light theme. Only if that fails try
to switch prefers-dark-theme.
Differential Revision: https://phabricator.services.mozilla.com/D187393
This is basically bug 1795066, but for the non-ScreenGetterWayland
code-path.
Properly supporting GetWidgetScreen in ScreenGetterGTK caused this to
surface in environments where we'd otherwise reported the primary
monitor (which usually starts at 0, 0).
Differential Revision: https://phabricator.services.mozilla.com/D187297
Always pull and track the scale from the topmost window. Keep that one
always up-to-date, which makes accessing it cheaper.
Differential Revision: https://phabricator.services.mozilla.com/D186465
GdkCeiledScaleFactor() can't be called from non-main thread (compositor, renderer etc.).
In such case just return recent scale factor and don't update it.
If it's changed it will be updated from main thread later.
Differential Revision: https://phabricator.services.mozilla.com/D184171
Remove hidden GdkCeiledScaleFactor() call from moz_container_wayland_set_scale_factor_locked() and pass it directly there.
It reduces number of GdkCeiledScaleFactor() calls and make sure scale is not changed surprisingly.
Differential Revision: https://phabricator.services.mozilla.com/D184170
Move EGLWindow resize code from nsWindow to MozContainerWayland. It allows to use container lock and make the operation thread safe.
Depends on D184121
Differential Revision: https://phabricator.services.mozilla.com/D184122
In order to bring the GMP process in closer alignment with how other
special purpose processes work, we need to be able to use the same
component services generally expected. This patch makes the GMP process
allow the same services as seen in the GPU/VR/RDD/Utility processes.
Differential Revision: https://phabricator.services.mozilla.com/D185336
This fixes screen sizes when using mutter with fractional scaling, and
shouldn't change behavior otherwise.
Without this patch, mutter with scale at 150% reports:
[screen.width, screen.height] == [ 1920, 1080 ]
With this it reports the proper [ 2560, 1440 ].
The bug that caused us to introduce it was long fixed in gtk itself, as
I understand it, and ScreenGetterGtk is also what's used everywhere else
on Wayland.
Re-implement GetScreenForWindow in a way that works for ScreenGetterGtk
too, to avoid regressing any functionality on mutter.
Depends on D186341
Differential Revision: https://phabricator.services.mozilla.com/D186342
Migrate WakeLockListener from dbus-glib to GDBus and use AsyncDBus module for it.
Changes:
- Use AsyncDBus to implement DBus interfaces to WakeLockListener. It uses promises to handle async DBus calls.
- Enable to run Wayland/X11 WakeLockListener if DBUS is disabled
- Add more logging code
Differential Revision: https://phabricator.services.mozilla.com/D186100