1
0
Fork 0
Commit graph

28563 commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
f231672084 monitor: Add support to privacy screen
Some monitors support hardware features to enable the privacy screen
mode that allows users to toggle (via software or hardware button) a
state in which the display may be harder to see to people not sitting
in front of it.

Expose then this capability to the monitor level so that we can get its
state and set it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
2022-01-25 07:31:19 +00:00
Sebastian Wick
8ebdae8092 launcher: Use $XDG_SESSION_ID if available
In some cases mutter is started in the user scope from a TTY (for
example using toolbox). Using sd_pid_get_session fails because it's not
in the session scope so it falls back to the primary session
(sd_uid_get_display). We want to start mutter on the TTY we started
mutter on however. Instead of relying on the scope to figure out the
correct session we first look at $XDG_SESSION_ID which is set by
systemd_pam.so.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2254>
2022-01-24 18:09:44 +01:00
Daniel Mustieles
97257157ba Updated Spanish translation 2022-01-21 11:35:45 +01:00
Andy Holmes
b7ea424605 documentation: Generate API references with gi-docgen
gtk-doc support was taken out about six years ago, but never replaced.
Add support for the newer gi-docgen, which should hopefully encourage
both C and GJS users of these libraries to improve the reference.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2248>
2022-01-20 07:48:44 -08:00
Robert Mader
dea9f8bbfe wayland/surface: Make ensure_cached_state() static
There is no reason for it to be public or have a return value.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2232>
2022-01-19 17:13:17 +00:00
Robert Mader
e3f0efa065 wayland/surface: Ensure to apply cached state
It is possible that we never create a cached state for a surface
even if it is synced. That is the case if `commit()` is never called.
We still need to call `apply_state()` in this case in order to run
e.g. `role_post_apply_state()` or `parent_state_applied` on subsurfaces.

So just ensure to initialize the cached state instead of bailing out.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2232>
2022-01-19 17:13:17 +00:00
Robert Mader
03434e566a wayland/subsurface: Ensure cached state recursivly gets applied on set_desync()
Subsurfaces can be effectively synced indirectly via their ancestors.
Right now such indirectly synced surfaces don't apply their cached
state when their ancestor effectively becomes desync as by the time
we call `parent_state_applied()` on them, they are considered as
desync.

Thus sligthly reoder things so when the ancestors becomes desync
and applies its state, those surfaces still count as synced and
will thus apply their cached state as well.

While on it, add a check to prevent `set_desync()` to have side
effects when the target surface is not currently synced.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2232>
2022-01-19 17:13:17 +00:00
Kukuh Syafaat
68b6507429 Update Indonesian translation 2022-01-19 09:39:50 +00:00
Michel Dänzer
5127f7df56 native/cogl-utils: Add 10 bpc format support
Avoids assertion failure in meta_drm_buffer_gbm_fill_timings with direct
scanout of a 10 bpc EGL client surface (which works now with dma-buf
feedback).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2230>
2022-01-17 10:39:13 +00:00
Daniel van Vugt
6673fbcf68 onscreen/native: Remove a goto in DisplayLink fallback
At first glance the `goto` looks like a loop, or potentially an infinite
loop. It's not a loop because the mode has changed at that point to
`META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY`. But we can make it more
obvious and avoid the need for a goto.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2240>
2022-01-17 10:03:17 +00:00
Jonas Ådahl
35fa75a085 clutter/backend/x11: Remove stray whitespace
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
e4e0eaac9d clutter/backend/x11: Stop keeping track of the screen and root window
They are now only ever accessed via the actual X11 backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
cf00ee9724 stage/x11: Get root window from the X11 backend
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
c41d2a17da xkb-a11y/x11: Get X11 display from X11 backend
Instead of from ClutterX11.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
4622bd7ca8 xkb-a11y/x11: Cleanup include macros
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
7851e69bbf virtual-input-device/x11: Get X11 display and screen from X11 backend
Instead of from ClutterX11.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
d796c40156 seat/x11: Get root window from X11 backend
Instead of going via ClutterX11.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
b1fb8cbf57 backend/x11: Add API to get the X11 screen
Will be used to replace a similar ClutterX11 API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
440359e85f virtual-input-device/x11: Cleanup include macros
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
1930cc771d clutter/virtual-input-device: Add API to get seat
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
39e1d5a214 stage/x11: Fetch the X11 display pointer from the X11 backend
This eliminates going through the clutter backend singleton.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
5eae0c84ed stage-impl: Change the backend pointer to MetaBackend
A pointer to the real backend is more useful, so lets use that. This
affects various places that now need to fetch e.g. the clutter backend
via the real backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
c0fb52cfe6 stage-impl: Move properties from the stage window here
The stage window is an interface, that added properties, that were only
then actually managed by MetaStageImpl. Shuffle things slightly, and let
the MetaStageImpl object deal with these things itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:51 +01:00
Jonas Ådahl
ed112fe0c6 keymap/x11: Store a MetaBackend pointer instead of ClutterBackend
What the keymap eventually is after, are things handled by the actual
backend (MetaBackendX11), so let it keep a pointer to that. This
eliminates some usages of globals.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:48:50 +01:00
Jonas Ådahl
eae1e532dd seat/x11: Make clutter backend variable naming more consistent
Name ClutterBackend pointers clutter_backend. That'll make things less
confusing when mixed with MetaBackend pointers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:45:36 +01:00
Jonas Ådahl
fc3b80fc60 input-device/x11: Get X11 state from the X11 backend
Go directly to the X11 backend to get the root window and X11 display
connection. This eliminates some uses of clutter globals.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:45:36 +01:00
Jonas Ådahl
05b655e60f seat/x11: Add API to get backend
Will be used instead of going via globals by places that already has a
seat to fetch things from.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:45:36 +01:00
Jonas Ådahl
dfbe97a8e5 backend/x11: Add API to get the root window
Will later be used from here instead of via the clutter backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:45:36 +01:00
Jonas Ådahl
6f80c1e7b5 seat/x11: Keep a pointer to the backend
This adds a pointer to the backend and replaces places that fetched
backend resources via globals (mostly via clutter).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
2022-01-17 09:45:36 +01:00
Aurimas Černius
56f150aa31 Updated Lithuanian translation 2022-01-16 21:33:57 +02:00
Jonas Ådahl
585befbf7d tests: Add test for constraining pointer on hotplug
It tests that if we go from (x is the pointer cursor)

    +--------+
    |        |
    |     X  |
    +--------+

to
             +----------------+
             |                |
             |                |
    +--------+                |
    |        |                |
    |     X  |                |
    +--------+----------------+

i.e. making sure that X ends up somewhere within the logical monitor
region.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Jonas Ådahl
d84f7971e4 tests/utils: Add meta_wait_for_paint() helper
This function queues a full stage redraw, then waits for every view to
receive the "presented" signal before returning.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Jonas Ådahl
57d1d82ead test/utils: Add helper to set custom monitors config
Make the existing implementation a wrapper to avoid changing monitor
config tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Jonas Ådahl
1f758dd78c test/utils: Make (WAYLAND_)DISPLAY passing to client optional
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Jonas Ådahl
1886785b3d test/utils: Make meta_test_client_do*() not crash on NULL error
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Jonas Ådahl
68fd9bf534 test/utils: Add vararg variant of meta_test_client_do()
To be used by wrapper that puts the error in a g_error().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Carlos Garnacho
5e3f89e342 backends: Do not try to move pointer onscreen in common code
This is now handled inside the input thread in the native backend,
and X11 has always done something similar to this. This common code
is no longer necessary.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Carlos Garnacho
70e44c281c backends/native: Ensure pointer is onscreen in input thread
It's slightly racy to have the main thread update the views and warp
the pointer, since the input thread may not be aware yet of the new
viewport layout.

Make the input thread clamp the pointer so it remains onscreen
instead, when the new viewports are obtained.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/64
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
2022-01-16 18:38:20 +00:00
Björn Daase
75e220a1c1 boxes-tests: Make pointer declaration match code style
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2236>
2022-01-14 20:04:20 +01:00
Björn Daase
cbc6965b80 boxes: Make pointer declaration match code style
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2236>
2022-01-14 20:02:26 +01:00
Björn Daase
5f78e932a8 boxes: Fix grammar in warning
Spotted while debugging https://gitlab.gnome.org/GNOME/mutter/-/issues/64

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2236>
2022-01-14 19:12:02 +01:00
Björn Daase
ee96ba44f9 boxes: Remove double whitespace
Spotted while debugging https://gitlab.gnome.org/GNOME/mutter/-/issues/64

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2236>
2022-01-14 19:10:20 +01:00
Marek Černocký
ad08e9e155 Updated Czech translation 2022-01-14 12:19:43 +01:00
Jonas Ådahl
812954b22c tests: Add ways to run privileged tests without KVM
These will be skipped by default, but can be run from a TTY for easier
debugging by doing:

    dbus-run-session -- meson test -C build --suite mutter/native/tty --setup plain

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00
Jonas Ådahl
06eb27d503 tests: Run KMS tests inside a QEMU virtual machine
This commit makes it possible to run test executables in a test
environment constructed of a virtual machine running the Linux kernel
with the virtual KMS driver enabled, and a mocked system environment
using meta-dbus-runner.py/python-dbusmock.

The qemu machine is configured to use 256M of memory, as the default
128M was not enough for the tests to pass.

Using qemu is also only made possible on x86_64; more changes are needed
for it to be runnable on aarch64, so add a warning if it was enabled on
any other architecture.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00
Jonas Ådahl
b5284e5ccc tests/dbus-runner: Add methods needed for taking control of a session
This is needed if one wants to run the test suite parts that need KMS or
evdev access in a virtual machine.

However, only initiate these methods if the meta-dbus-runner.py program
was launched with --kvm, as it's only suitable for using while running
as root in a virtual machine.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00
Jonas Ådahl
1cc786ffd3 launcher: Pass fallback session/seat ID when in test mode
When we test, we might not have a systemd session to rely on, and this
may cause some API we depend on to get various session related data to
not work properly. Avoid this issue by passing fallback values for these
when we're running in test mode.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00
Jonas Ådahl
8372af9cd7 tests/mock/logind: Add mock seat and session
Will be needed for KMS testing in KVM.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00
Jonas Ådahl
9538143fac dbus-runner: Add some high level logging
Will log about starting services and running test case.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00
Jonas Ådahl
8b628f0ae4 launcher: Fix indentation
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
2022-01-14 09:16:09 +00:00