135 Commits

Author SHA1 Message Date
Sebastian Wick
cbdc3ae9f5 wayland/cursor-shape: Enable the protocol by default
We now have tests, a GTK implementation that was tested on it and the
protocol version 2 changes are upstream. Time to enable it by default.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4307>
2025-03-11 09:55:02 +00:00
Jonas Ådahl
be6af00d6b DisplayConfig: Add API to get and set output luminance
This will in turn change the GSetting, where the setting is actually
stored.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4271>
2025-02-27 13:13:42 +01:00
Jonas Ådahl
8cae2e7b08 debug-control: Remove output luminance knob
It was replaced with an actual setting and is no longer used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4271>
2025-02-27 13:13:42 +01:00
Jonas Ådahl
bdf1ff0360 settings: Add output luminance settings to org.gnome.mutter
This aims to allow configuring the output luminance currently used via
the color state shaders. It will replace the output luminance property
of the debug control API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4271>
2025-02-27 11:35:22 +00:00
Mattia Formichetti
9fe83c736c schemas: Center windows by default
Now that the requirements to do this are met, we can finally
center new windows by default.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2123
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1662
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/246
Closes: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1898442
Closes: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1298263
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4294>
2025-02-26 10:13:22 +00:00
Sebastian Wick
8fb2a8a4b8 wayland/color-management: Expose the protocol by default
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4291>
2025-02-25 02:40:17 +00:00
Lukáš Tyrychtr
a817d7c137 core: Add a debug control override to disable the a11y manager ACL
This commit adds another way how to disable the a11y manager ACL in development.
Setting the unsafe mode might not be as straightforward as setting an
environment variable for the session, and you can control it invidually too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4217>
2025-02-25 02:14:46 +00:00
Lukáš Tyrychtr
20c9b8cf0c backends: Add a11y interface methods to subscribe to key event input
This adds a pair of methods to signal an interest in receiving
all key events without grabbing them, e. g. the previously expected behavior
by screen readers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4217>
2025-02-25 02:14:46 +00:00
Lukáš Tyrychtr
84fc62a280 data: Introduce the DBus interface description for the a11y manager
This object will for now only provide a way for assistive technologies
to receive keyboard events, however it is expected that it will be used for
the new a11y communication protocol in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4217>
2025-02-25 02:14:46 +00:00
Sebastian Wick
25bb319ec2 debug-control: Add property for toggling the cursor shape protocol
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3668>
2025-02-19 18:06:45 +00:00
Alessandro Bono
5aabd66481 schemas: Set Super as default for overlay-key
Now with the new parsing mechanism we are able to set `Super` as
default for overlay-key. The parsing of the `Super` string will
fail at the new mechanism will kick in by appending `_L` and `_R`.
The parsing of the new two strings then will succeed and we will
be able to use both Super_L and Super_R to activate the overview.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
2025-02-13 22:43:50 +00:00
Jonas Ådahl
d855623fb4 Replace HDR debug toggle with o.g.M.DisplayConfig API
HDR being enabled was controlled by toggling a property on
org.gnome.Mutter.DebugControl, which affected how the color space and
HDR metadata of the output was configured. Replace this with a higher
level MetaMonitor / MetaOutput level "color mode" enum, that is also
reflected in the monitor configuration API.

This enum is then used to derive the color space and HDR metadata at the
lower level where it matters. The ForceHDR debug control property is
still left there, as it only affects the color space and transfer
function of the view related to a monitor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
a39e941f91 DisplayConfig: Advertise monitor color standard support
It'll be used to allow Settings to know whether it can enable HDR or
not.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Sebastian Wick
e1aeb86bc9 dbus-interfaces: Update the login1 dbus interface definition
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:49:15 +01:00
Jonas Ådahl
ea9e8bff2d debug-control: Add InhibitHwCursor property
Inhibits the hardware cursor globally when true.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
2024-12-11 16:22:57 +00:00
Jonas Ådahl
f4201bc3d3 service-channel: Add global shotcuts portal backend client type
The global shortcuts portal backend component lives in
gnome-control-center, and is responsible for preseting the GUI for
managing client provided global shortcuts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4173>
2024-12-10 17:02:24 +00:00
José Expósito
479bb6921d monitor-manager: Configure for lease monitors in ApplyMonitorsConfig
Add a new property to the ApplyMonitorsConfig D-Bus API allowing to set
a list of monitors for lease.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4121>
2024-11-15 14:58:32 +00:00
José Expósito
c93e06696f monitor-manager: Return for lease status in GetCurrentState
Add a new property to the list of monitors returned by the
GetCurrentState D-Bus API indicating whether the monitor is available
for lease or not.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4121>
2024-11-15 14:58:32 +00:00
José Expósito
62e5706ed5 dbus-interfaces: Fix type in GetCurrentState doc
The XML type is correct, but the documentation was missing a string.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4116>
2024-11-04 21:52:56 +00:00
Sebastian Wick
2f3ad4be5c core/debug-control: Add new ForceHDR debug control
It will be used to force the color state of all monitors to be as if
they managed to turn on HDR mode. This is useful for debugging shaders
in an environment where an HDR mode capable display is not available,
such as the nested mode.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4035>
2024-10-15 10:37:36 +00:00
Carlos Garnacho
2074e4e146 core: Add debug control setting for session management
We will at the moment want it guarded behind a setting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Jonas Ådahl
7c7e147fd2 display-config: Add HasExternalMonitor property
This aims to replace gnome-setting-daemon manually trying to figure this
state out, currently via libgnome-rr.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:19:16 +02:00
Jonas Ådahl
cc0ec14712 monitor-manager: Add new backlight D-Bus API
It is intended to replace using GetResources() and ChangeBacklight().

It moves from a normalized 1-100 numbers, to directly exposing the
hardware. This more closely maps to how gsd-backlight.c in
gnome-settings-daemon normally works, and simplifies the API a bit to
not have to deal with rounding issues.

There is still no KMS uAPI for this, so it still only hooks up to
XRANDR. Being private API, it doesn't try very hard to predict how the
KMS uAPI will look. When that day comes, it will likely need some
adaptations.

Part of the motivation here is to get something for gsd-backlight.c to
use where it can work more similarly to how the current common case
(sysefs) works, while attempting to migrate away from libgnome-rr.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:19:16 +02:00
Jonas Dreßler
e2db6c8276 Add an experimental feature for letting Xwayland clients scale natively
With the next commits we'll introduce a new mode for scaling of Xwayland apps,
we'll want to put this mode behind an experimental setting though, so add
that setting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Ådahl
7635abcbf4 x11-display: Expose UI scaling factor via D-Bus
This replaces the `legacy-ui-scaling-factor` entry in
`org.gnome.Mutter.DisplayConfig`, with the motivation being to no longer
expose X11 specific state via the monitor configuration API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Sebastian Wick
6fa61a088f core/debug-control: Allow changing the reference luminance of outputs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3953>
2024-08-30 20:03:43 +00:00
Sebastian Wick
1b2d0a4d4a debug-control: Add property for toggling color management protocol
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3893>
2024-08-29 23:00:34 +00:00
Lukáš Tyrychtr
a35326cc93 dbus-interfaces: Fix ApplyMonitorsConfig documentation
The "overscanning" property had its name at least from 2019,
but the documentation was wrong all that time.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3624
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3957>
2024-08-19 13:01:46 +02:00
Georges Basile Stavracas Neto
cdbe0a27a2 service-channel: Add client type for filechooser portal
Add a new service client type for a filechooser portal client, and
expose the x11_interop protocol to it.

This will be used to make Nautilus a file chooser portal implementation.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3694>
2024-08-06 16:07:48 +00:00
Jonas Ådahl
0c2fa8e9a8 clutter/stage-view: Add linear intermediate color space buffer
Allow compositing in a linear color space and do so either when forcing
it via the debug controls D-Bus API, or when the experimental HDR mode
is enabled.

This relies on paint nodes etc to actually transform everything into the
linear target color space, which isn't done yet, so enabling it right
now will cause a broken result. Yet, introduce this now, so that
painting can be fixed piece by piece.

Linear blending is automatically enabled on monitors where HDR is
enabled, as this makes it possible to use an linear color space when
blending content from different color spaces with different transfer
functions.

Linear blending requires extra precision, i.e. 16 bit per channel
in the intermediate buffer due how the values are distributed,
so only enable the experimental HDR mode if the Cogl context supports
half float formats.

By default, no intermadiate linear offscreen framebuffer is used.

To test, do e.g.

  ./tools/debug-control.py --toggle ForceLinearBlending

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:55:54 +02:00
Daniel van Vugt
b684b5cf05 build: Compile schemas locally for use in build tests
So they don't need to be installed system-wide before build testing
can work.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3368
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3800>
2024-06-13 22:14:51 +00:00
Philip Withnall
1b64353427 dbus-interfaces: Add some docs to the IdleMonitor interface
They’re not complete, but they’re something.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3768>
2024-05-26 10:04:19 +00:00
Ivan Molodetskikh
25c9cff7be dbus-interfaces: Fix layout-mode comment
This corresponds to the values in the code. The second comment is
correct.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3671>
2024-04-05 13:45:01 +00:00
Dor Askayo
8df0beae08 monitor-manger: Expose the minimum refresh rate of monitors
This exposes the minimum refresh rate of monitors through D-Bus.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
2024-03-02 12:35:36 +00:00
Dor Askayo
732f5afe13 monitor-manager: Add support for refresh rate modes
The refresh rate mode is exposed in the DisplayConfig D-Bus interface
and is made persistent through monitors.xml.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
2024-03-02 12:08:21 +00:00
Dor Askayo
e72baac97d settings: Add experimental feature for variable refresh rate
Require the "variable-refresh-rate" keyword under the
"experimental-features" gsetting to enable the feature for now.

It would no longer be required once the experience with variable
refresh rate is good enough for general use and handles all common
use cases well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
2024-03-02 12:08:21 +00:00
Dallas Strouse
c8c5560916 backends/native: Main thread rt-scheduler: experimental feature no more
To paraphrase jadahl: we have a dedicated KMS thread now, which also
has realtime scheduling enabled unconditionally. realtime scheduling
on the main thread isn't too great of an idea, considering GC can
take a hot minute.

And to quote rmader: we most likely won't be able to make the main
thread rt as long as we use GJS and thus have GC.

So let's get rid of it! It's just been breaking things anyways.

This just ignores the setting; we'll fully remove it when GNOME 46
comes around.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3296>
2024-01-13 15:10:31 +01:00
Bilal Elmoussaoui
fded7d29df data: Remove no longer used icon
It is also very ugly and doesn't represent the current state of Mutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3484>
2024-01-09 13:38:54 +00:00
Jonas Ådahl
adc5489ba7 Add debug controller
The debug controller can optionally, when passing --debug-control,
enable manipulating debug state, so far enabling/disabling HDR, via
D-Bus.

It's always created, in order to have a place to store debug state and
emit signals etc when it changes, but so far, it doesn't have its own
state it tracks, it just mirrors that of the monitor manager.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3432>
2023-12-01 14:25:08 +00:00
Pascal Nowack
a2a4067e07 screencast: Add ability to stop streams
When a stream is destroyed by a consumer, mutter won't be able to
recognize that.
For mutter, the stream just paused, but did not disconnect, because the
connection state of a PipeWire stream only represents, whether the
respective PipeWire context is connected to PipeWire.
In addition to that, it may be the case, that the stream consumer just
recreates the stream.
So even if mutter would be able to know, when the stream consumer
destroyed a stream, but not the whole screencast or remote-desktop
session, then mutter would not know, whether the stream will be resumed
eventually or not.

So, add an explicit API call to the screencast interface to stop a
stream.
For virtual streams, this also means, that the respective virtual
monitor is destroyed.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2889
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3307>
2023-11-30 12:22:59 +01:00
Jonas Ådahl
2eda81aadf remote-desktop/session: Limit device type access when using libei
The portal could limit access to certain device types, but this was not
forwarded to the EIS context. Add a way to do this, and make use of it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3228>
2023-09-01 10:43:26 +00:00
Olivier Fourdan
6d0b682d98 remote-desktop/eis: Add support for ConnectToEIS.
Remote desktop version 2 added a new method ConnectToEIS .

ConnectToEIS allows clients to requests a file descriptor from the
compositor which can then be used directly from libei.

Once established, the communication between compositor and application
is direct, without the need to go through the portal process(es).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628>
2023-07-14 22:23:45 +00:00
Jonas Ådahl
2fb3bdf774 input-capture: Hook up capturing of events to active session
This adds the actual input capturing rerouting that takes events and
first hands them to the input capture session, would it be active.
Events are right now not actually processed in any way, but will
eventually be passed to a libei client using libeis.

A key binding for allowing cancelling the capture session is added
(defaults to <Super><Shift>Escape) to avoid getting stuck in case the client
doesn't even terminate the session.

The added test case makes sure that the pointer moves again after
pressing the keybinding.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628>
2023-07-14 22:23:45 +00:00
Jonas Ådahl
2a8c11d69b input-capture: Add D-Bus method to clear barriers
This will be needed by the portal backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628>
2023-07-14 22:23:45 +00:00
Jonas Ådahl
a8b013b006 Add beginning of input capture API
This API aims to provide a way for users to capture input devices under
certain conditions, for example when a pointer crosses a specified
barrier.

So far only part of the API is implemented, specifially the session
management as well as zone advertisement, where a zone refers to a
region in the compositor which edges will eventually be made available
for barrier placement.

So far the remote access handle is created while the session is enable,
despite the input capturing isn't actually active yet. This will change
in the future once it can actually become active.

v2: Remove absolute/relative pointer, keep only pointer (ofourdan)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628>
2023-07-14 22:23:45 +00:00
Robert Mader
9be511453e Revert "udev-rules: Disable sending modifiers to clients with amdgpu"
Original commit message:
> ATM sending modifiers to clients prevents direct scanout for DRI3
> clients via Xwayland. Xwayland using the dma-buf feedback v4 Wayland
> protocol will solve that, but that might take a while yet to appear in
> the wild. Once that happens, this can be reverted.
>
> Direct scanout still works for native Wayland clients as well.

Xwayland got support for v4 in 23.1.0, thus let's reenable modifiers on
AMD.

This reverts commit 2f825f3a8678284ed7ca116526dc053587eb329a.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3030>
2023-05-30 14:25:18 +02:00
Dmitry V. Levin
26d13f4269 udev-rules: Fix warnings reported by udevadm verify
Fix the following warnings reported by udevadm verify:

data/61-mutter.rules:2 Whitespace after comma is expected.
...
data/61-mutter.rules:116 Whitespace after comma is expected.
data/61-mutter.rules: udev rules check failed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3011>
2023-05-22 16:35:24 +00:00
Alexandre Franke
eab928918d Fix shortcut wording
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2982>
2023-05-08 21:00:05 +00:00
Jonas Ådahl
39b28ad8c8 build: Join keybindings path correctly too
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2985>
2023-05-04 12:35:38 +00:00
Jonas Ådahl
61b42e5303 build: Use / operator instead of join_paths everywhere
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2985>
2023-05-04 12:35:38 +00:00