1
0
Fork 0
Commit graph

76 commits

Author SHA1 Message Date
Jonas Ådahl
b3fa4a6cd8 color-manager: Add API to set brightness
It uses the org.gnome.SettingsDaemon.Power.Screen D-Bus API. Currently
brightness set if the proxy is not ready are ignored; whether the
brightness value should be cached and set once it appears or whether
color profiles should be reapplied is yet to be decided.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2165>
2022-09-01 17:52:01 +02:00
Jonas Ådahl
43cd70089e color-manager: Set up a D-Bus proxy to org.gnome.SettingsDaemon.Color
gsd-color provides this API, which exposes details about the night light
state. Currently, gsd-color also turns this state into CRTC gamma
changes, but this will eventually change, and this is a preparation for
this.

The proxy isn't yet used for anything.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2164>
2022-09-01 16:54:04 +02:00
Salman Malik
e2d4da8562 screen-cast-stream: Embed the wayland output name to streams
If a screencast session is screencasting from multiple monitors,
it is not possible to distinguish which stream (or PipeWire stream
node id) belongs to which connected monitor (such information may be useful
to the caller e.g. caller might want to embed the stream in a window
and name it after the monitor connector, for example). This change adds
optional metadata for monitor streams to also return the wayland output
name with the stream.

Ideally, this metadata should equip the caller to get more information about
display from the following Wayland interfaces:

https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_output
https://wayland.app/protocols/xdg-output-unstable-v1

Related:
- https://github.com/flatpak/xdg-desktop-portal/pull/832
- https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/48

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2540>
2022-08-15 17:01:27 +00:00
Jonas Ådahl
8fdb80a718 monitor-manager: Add NightLightSupported property to DisplayConfig
This checks whether it's possible to set a CRTC GAMMA_LUT, which is what
is necessary to implement night light.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2310>
2022-05-17 08:42:25 +00:00
Jonas Ådahl
52ce81657d backend/native: Only disable dmabuf screen cast when not hw accelerated
We now only enable DMA buffer based PipeWire screen casting if a
format/modifier has been negotiated. This practically means a consumer
is aware about what is needed, and we should not try to predict that it
uses the DMA buffer the right way (i.e. not mmap:ing directly).

However, in case we're not hardware accelerated, we never want to
attempt to use DMA buffer screen sharing, as we want to avoid
compositing into a DMA buffer on such hardware as doing so can be very
slow.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2086>
2022-02-07 19:16:45 +00:00
Olivier Fourdan
226afa24aa xwayland: Use Xwayland auto-terminate feature
When using Xwayland-on-demand (default), if the (experimental) autoclose
features is enabled, we can rely on Xwayland's auto-terminate feature
instead of explicitly killing the Xwayland process.

With it, gone is the mechanism that was added to check the X11 clients
connected and their executable to check whether we can (safely) kill
Xwayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1794>
2022-01-26 14:42:22 +01:00
Jonas Ådahl
b49421d8e8 monitor-config-store: Allow changing D-Bus configuration policy
Adding a <dbus/> element containing a boolean (yes/no) determines
whether org.gnome.Mutter.DisplayConfig ApplyMonitorsConfig will be
callable. The state is also introspectable via the
ApplyMonitorsConfigAllowed property on the same interface.

For example

    <monitors version="2">
      <policy>
        <dbus>no</dbus>
      </policy>
    </monitors>

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Pascal Nowack
ecd45d28ac remote-desktop: Unify codestyle in API
The code style in the remote-desktop API is currently a mess.
While, the overall code style in mutter and gnome-remote-desktop is to
use spaces as tabulator, the remote-desktop API is mixed with both
spaces as tabulators and actual tabulators.
In addition to that, the code style in the XDG desktop portal APIs uses
spaces as tabulators as well.

To unify the code style, replace all actual tabulators with spaces.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2255>
2022-01-25 10:49:12 +00:00
Pascal Nowack
cff95d4932 screencast: Unify codestyle in API
The code style in the screencast API is currently a mess.
While, the overall code style in mutter and gnome-remote-desktop is to
use spaces as tabulator, the remote-desktop API is mixed with both
spaces as tabulators and actual tabulators.
In addition to that, the code style in the XDG desktop portal APIs uses
spaces as tabulators as well.

To unify the code style, replace all actual tabulators with spaces.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2255>
2022-01-25 10:49:12 +00:00
Marco Trevisan (Treviño)
fd1f6094c9 monitor-manager: Expose the privacy screen state on DBus current state
Expose each monitor state as two booleans, not to expose the whole flags

Related-to: GNOME/gnome-control-center#909
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
2022-01-25 07:31:19 +00:00
Jonas Ådahl
8de449dc72 udev-rules: Only disable modifiers on i915
The only currently known issue with allocating scanout buffers with
modifiers is memory constraints in multi head setups. Heuristics for
handling that are not implemented, but since it doesn't apply to
anything but i915, remove the other drivers from the deny list.

The other drivers had modifiers disabled to marginally increase the
chance of becoming scanout-able when allocated by Xwayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2146>
2022-01-05 20:00:36 +00:00
Jonas Ådahl
e6a2d61a2f gschema: Make 'kms-modifiers' only about scanout buffers
It's not used to determine what we send to Wayland clients anymore, it
does so by default.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2146>
2022-01-05 20:00:36 +00:00
Jonas Ådahl
1978e93f28 wayland/dma-buf: Prepare format/modifier map up front
As the format table is setup up front, it doesn't change when this
experimental feature setting change. Make the settings documentation
reflect that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1959>
2022-01-05 16:36:48 +00:00
Jonas Ådahl
70c6d28fca ScreenCast: Allow recording new streams on active sessions
This is useful if you have a session, and want to "hot-plug" new sources
over time; there is no point in having to create separate sessions for this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2131>
2021-12-07 19:23:52 +00:00
Jonas Ådahl
3c1f50a85e Move D-Bus interface files to dedicated directory
Place the XML files in data/dbus-interfaces.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2126>
2021-12-07 18:52:29 +00:00
Robert Mader
331f08fc40 gschema: Turn experimental features into flags
Defining valid values makes
1. changing settings less error prone
2. sure they are discoverable.

This does reset the values once on update, but fortunately does *not*
change the way to set the values. Thus e.g. enabling fractional scaling
via terminal command still works as before and internet guides stay valid.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1961>
2021-10-26 16:24:41 +00:00
Robert Mader
49aa801454 gschema: Add "kms-modifiers" experimental feature description
To make it more discoverable. While on it, fix a typo.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1961>
2021-10-26 16:24:41 +00:00
Carlos Garnacho
820aa18126 backends/native: Use rtkit to get realtime priority
Instead of using sched_setscheduler directly (and relying that we
somehow got CAP_SYS_NICE), use rtkit to do this for us.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2284
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2060>
2021-10-22 08:35:15 +00:00
Florian Müllner
1f26dc12e5 data: Stop exposing old panel-main-menu shortcut
There hasn't been a "panel main menu" for ten years now, and gnome-shell
already exports a 'toggle-overview' shortcut for the GNOME 3 replacement.

https://discourse.gnome.org/t/difference-between-show-the-overview-and-show-the-activities-overview-keyboard-shortcuts/6572

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1886>
2021-08-30 21:43:34 +00:00
Florian Müllner
6288763671 build: Stop using source_root()/build_root()
They were deprecated in meson 0.56.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1957>
2021-08-22 17:32:12 +00:00
Jonas Ådahl
c3feb83529 udev-rules: Use ID_PATH to detect vkms
Matching against the driver doesn't seem to work, and isn't showing in
udevadm info. Switch to checking ID_PATH; hopefully it won't change too
often.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1892>
2021-06-09 19:21:44 +00:00
Carlos Garnacho
f954ff84b8 backends/native: Disable KMS modifiers on "radeon" driver
This is a driver for old AMD/ATI GPUs and doesn't seem to support
modifiers. Tag this driver as not having support for KMS modifiers.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1960937
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1872>
2021-05-19 20:52:03 +02:00
Michel Dänzer
c5943cd082 meson: Add udev_dir option
Same as in gnome-settings-daemon, allows overriding where to install
udev rules files.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1844>
2021-05-04 15:53:24 +00:00
Jonas Ådahl
8989c42d40 backend/native: Add udev rule to ignore vkms devices
Virtual Kernel Mode Setting (vkms) is a virtual /dev/dri/card* device
not backed by any actual hardware. It's intended for testing purposes,
e.g. to run tests suites with a reproducable setup, or in continuous
integration pipelines.

Currently mutter don't have any tests that can run on top of vkms, but
will eventually get that. To prepare for the ability to do that, and
having said kernel module loaded without causing wierd issues with any
active session, add an udev rule that tells mutter to ignore any vkms
device.

Otherwise, when vkms is loaded, mutter would detect it, assume it's a
regular monitor, configure it as such, thus add a region of the stage
that ends up nowhere, which isn't very helpful. It might also conflict
with running actual tests that need to interact with vkms if the active
session has taken control of it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1740>
2021-04-30 15:10:28 +02:00
Florian Müllner
d2a492de94 data: Add back (hidden) shortcuts for vertical navigation
Users who customized their workspace shortcuts before updating to
GNOME 40 are experiencing troubles when trying to use the same
keybinding for the horizontal shortcuts, because of hidden conflicts
with the vertical ones.

We can address this by registering the old shortcuts with Settings
without showing them in the UI, so that they are taken into account
by Settings' conflict resolution.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1740

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1814>
2021-04-15 15:31:10 +00:00
Jonas Ådahl
ad1bffc002 backend/native: Disable KMS modifiers for amdgpu and nouveau as well
Lets wait until we have better ways to unredirect client buffers before
we start enabling KMS modifiers for amdgpu and nouveau; we end up with
mismatch between client buffer modifiers and primary plane modifier,
which right now needs to be the same for unredirection.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1792>
2021-04-14 07:14:24 +00:00
Jonas Ådahl
da3baba980 backend/native: Only disable KMS modifiers for i915
The intel DRM driver is known for not being able to handle multi head
setups when KMS modifiers are enabled, due to the implicitly selected
modifiers, while being more suitable for single head setups, cause
bandwidth issues when a certain number of monitor times resolution and
refresh rate is configured.

We don't yet support automatically finding a combination of modifiers
that work, and have because of this disabled KMS modifiers unless the
driver actually needs it.

Lets flip this configuration the other way around, changing the current
udev rule to decide wen to *disable* KMS modifier support, as it so that
only the Intel driver has this problem, while on the other hand, there
several drivers that requires modifiers to function at all.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1792>
2021-04-14 07:14:24 +00:00
Florian Müllner
36424ab298 data: Updated exposed keybindings
Workspaces were changed to a horizontal layout, so we should show
the keybindings for horizontal navigation in Settings instead of
the vertical ones.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1706>
2021-02-04 00:09:57 +01:00
Björn Daase
ea39379224 gschema: Fix capitalization of autoclose-xwayland option
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1696>
2021-02-01 18:56:39 +01:00
Olivier Fourdan
cde0cd5d23 xwayland: Enable Xwayland on demand by default
Make "Xwayland on demand" the default policy when Xwayland supports
"initfd" and remove the corresponding experimental feature.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1673>
2021-01-19 09:33:33 +01:00
Olivier Fourdan
3fc603edd3 xwayland: Make autoclose-xwayland an exp. feature
Closing automatically Xwayland once all relevant X11 clients are gone is
inherently racy, if a new client comes along right at the time we're
killing Xwayland.

Fixing the possible race conditions between mutter, Xwayland and the X11
clients may take some time.

Meanwhile, make that an experimental feature "autoclose-xwayland".

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1673>
2021-01-19 09:33:33 +01:00
Ian Douglas Scott
b2126fec92 gschema: Add missing summaries for toggle-tiled-left/toggle-tiled-right
Wording copied from `data/50-mutter-windows.xml`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1573>
2020-11-18 13:48:48 -08:00
Olivier Fourdan
935d594978 gschema/wayland: Do not disable the X Security extension
If Xwayland was built with the X Security extension enabled, it should
be safe to use, there is no need to disable it by default from mutter.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1485
2020-10-09 13:53:08 +00:00
Olivier Fourdan
58e2ac8671 gschema: really use line breaks in schema
The newline character `\n` in the schema does not produce a new line.
Use a newline instead.

fixes: dbe44f3a83
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1483
2020-10-08 14:54:45 +00:00
Björn Daase
dbe44f3a83 gschema: Force one bullet point per line
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
2020-10-08 15:41:19 +02:00
Björn Daase
e923641573 gschema: list experimental dma-buf-screen-sharing feature
The key was added in af9df1e5b6
but not added to the list due to the string freeze.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
2020-10-08 15:39:10 +02:00
Björn Daase
815583b534 gschema: Make "Requires a restart." strings consistent
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
2020-10-07 22:49:49 +02:00
Karol Herbst
9b9b912765 backends: force enable modifiers on tagged devices
Some devices can't scanout to linear buffers directly as the hw is not
capable of eg rendering into a linear depth buffer.

Add code to force kms-modifiers on udev taged devices.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1408

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
2020-09-28 14:00:44 +02:00
Olivier Fourdan
5171e35a97 xwayland: Add a setting to disable selected X extensions
The X server, including Xwayland, can be compiled with different X11
extensions enabled at build time.

When an X11 extension is built in the X server, it's usually also
enabled at run time. Users can chose to disable those extensions at run
time using the X server command line option "-extension".

However, in the case of Xwayland, it is spawned automatically by the
Wayland compositor, and the command line options are not configurable
by users.

Add a new setting to disable a selected set of X extension in Xwayland
at startup, without needing to rebuild Xwayland.

Of course, if Xwayland is not built with a given extension support in
the first place (which is the default for the security extension for
example), that option has no effect.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1405
2020-08-29 12:20:26 +02:00
Olivier Fourdan
17417a82a5 cleanup: remove controversial naming
Replace "whitelist" and "blacklist" with "allow_list" and "deny_list"
which better represent the purpose of those variables.

There is no functional change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1396
2020-08-04 10:04:16 +02:00
Jonas Ådahl
2da27720ca display: Make check-alive timeout configureable
The check-alive feature is there for the user to be able to terminate
frozen applications more easily. However, sometimes applications are
implemented in a way where they fail to be reply to ping requests in a
timely manner, resulting in that, to the compositor, they are
indistinguishable from clients that have frozen indefinitely.

When using an application that has these issues, the GUI showed in
response to the failure to respond to ping requests can become annoying,
as it disrupts the visual presentation of the application.

To allow users to work-around these issues, add a setting allowing them
to configure the timeout waited until an application is considered
frozen, or disabling the check completely.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1080
2020-02-23 17:28:57 +00:00
Carlos Garnacho
7ef32f747b wayland: Add setting/api to check the policy to set up the X11 display
This replaces meta_should_autostart_x11_display(). The "on-demand" policy
is not honored yet.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/709
2019-08-06 00:41:36 +00:00
Olivier Fourdan
851b7d0639 keybindings: Trigger locate-pointer on key modifier
We trigger the "locate-pointer" mechanism when a special key modifier
(defaults to Control_L) key is pressed and released.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/453
https://gitlab.gnome.org/GNOME/gnome-shell/issues/981
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/merge_requests/19
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/86
2019-06-05 09:34:39 +00:00
Olivier Fourdan
c9cc07fd3a settings: Slack off “xwayland-allow-grabs” setting
To emulate X11 grabs, mutter as a Wayland compositor would disable its
own keyboard shortcuts and when the X11 window is an override redirect
window (which never receives focus), it also forces keyboard focus onto
that X11 O-R window so that all keyboard events are routed to the
window, just like an X11 server would.

But that's a bit of a “all-or-nothing” approach which prevents
applications that would legitimately grab the keyboard under X11 (like
virtual machine viewers) to work by default.

Change “xwayland-allow-grabs” to control whether the keyboard focus
should be locked onto override redirect windows in case of an X11 grab.

For stringent needs, careful users can still use the blacklisting
feature (i.e. a list containing “!*”) to prevent grabs from any X11
applications to affect other Wayland native applications.

https://gitlab.gnome.org/GNOME/mutter/issues/597
2019-06-03 09:34:31 +02:00
Carlos Garnacho
dae2c1d420 backends/native: Add rt-scheduler experimental key to set RT scheduling
This is similar to a change in kwin:
https://blog.martin-graesslin.com/blog/2017/09/kwinwayland-goes-real-time/

If the experimental features key has "rt-scheduler", make it claim the lowest
of RT scheduler priorities, this will be both educated to other RT processes
and improves responsiveness wrt all other processes.

This can only work if mutter/gnome-shell process receives CAP_SYS_NICE
somehow, e.g.: "setcap CAP_SYS_NICE=+ep `which gnome-shell`"

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/921
https://gitlab.gnome.org/GNOME/mutter/merge_requests/460
2019-05-10 21:47:53 +00:00
Marco Trevisan (Treviño)
63c40a9711 meson: Define srcdir and builddir using meson functions
No need to redefine paths starting from top src/build dirs, as meson can give us
this information for free using its functions.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
2019-05-02 19:56:23 +00:00
Georges Basile Stavracas Neto
763ae36cee
Drop Autotools
I saw Meson fade from the sky
On the wind I heard a sigh
As snowflakes cover fallen Makefiles
I will say this last goodbye

Meson is now coming
So ends Autotools days
Future is now coming
And we must away
Over Python and without Bashisms
Through lands where never Meson touched
By silver streams that run down to the Sea

Under parsers, beneath old legacy
Over snow one winter’s morn
I turned at last to paths that lead home
And though where the road then takes me
I cannot tell
We came all this way
But now comes the day
To bid you farewell

Many places I have been
Many sorrows I have seen
But I don’t regret
Nor will I forget
All Makefiles that took that road with me

I bid you all a very fond farewell.
2019-01-10 11:50:54 -02:00
Jonas Ådahl
ef85d1a643 Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.

There are some differences between the autotools setup and the new
meson. Here are a few:

The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.

The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.

Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-11-06 18:51:44 +01:00
Jonas Ådahl
d5203f170e Make screen cast and remote desktop non-experimental
It's time to make this feature more accessible by not requiring editing
an array in gsettings.
2018-06-07 12:57:51 +00:00
Florian Müllner
32547d2eff data: Don't expose window shading shortcut
GTK+ doesn't support shading of client-side decorated windows, and likely
never will (not least because shading is conceptually questionable if the
app customizes the titlebar), and neither do other CSD implementations like
Chromium's. A shortcut that only works with a decreasing number of windows
is more confusing than helpful, so don't expose it.

https://bugzilla.gnome.org/show_bug.cgi?id=645460
2018-01-24 19:09:27 +01:00