13394 Commits

Author SHA1 Message Date
Nick Diego Yamane
3ca7539869 wayland/xdg-toplevel-drag: Do not set grab actor names for window drags
Those names (name and accessible-name) don't seem to be that useful
after all, so get rid of them, which simplifies the window drag grab
setup impl.

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

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4220>
2025-02-05 15:39:32 +00:00
Peter Hutterer
65db49cafa core: Don't show the pad mode button group if we only have a single group
Only a tiny number of tablet pads that have more than one mode
group, everyone else has one mode toggle button and one group.
Let's not display "Group 0" for everyone if (almost) no-one has a Group
1 anyway.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4248>
2025-02-05 13:21:54 +00:00
Peter Hutterer
751277a7ef virtual-input-device/native: Drop the separate "seat" property
The "seat" property is already used by the parent
ClutterVirtualInputDevice - re-using this property means the parent's
propery never gets set so clutter_virtual_input_device_get_seat()
returns NULL.

This causes mutter to crash if a tablet pad sends a key event via a pad
ring or strip.

Since this type is only ever constructed with a MetaSeatNative as seat
we can extract that object through the parent and drop our property.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4247>
2025-02-05 12:37:44 +00:00
Jonas Ådahl
01c9c428b7 tests: Add remote desktop tests
This requires a newer libei, for ei_ping.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 17:38:32 +08:00
Jonas Ådahl
e6e725591e tests/remote-desktop-utils: Add libei helpers
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 17:27:19 +08:00
Jonas Ådahl
25fc60cdc5 tests/test-utils: Add command watcher helper
This can be used to allow passing commands via stdout from tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 10:28:19 +08:00
Jonas Ådahl
7b0a65d728 tests/test-utils: Pass subprocess flags when launching test executable
Will be used to create stdin/stdout pipes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 10:28:19 +08:00
Jonas Ådahl
3b1067e783 remote-desktop-session: Only add configured streams as viewports
Otherwise we risk adding streams that don't yet have a virtual monitor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 10:28:19 +08:00
Jonas Ådahl
14eedb38df eis-client: Only remove MetaEisDevice when eis_device is removed
When we recreate devices, or unbind device classes, don't remove the
device from the hash table and free MetaEisDevice quite yet - only do so
when the eis_device is actually removed.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3839
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 10:28:19 +08:00
Jonas Ådahl
4d9a818321 eis: Don't warn on unhandled EIS event types
They are expected to be handled by libeis if we're not, so don't warn
about that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 10:28:19 +08:00
Jonas Ådahl
5708c6c5d1 dbus-session-manager: Generate session IDs that one doesn't need to escape
This makes it easier to deal with in test cases that uses
g_shell_parse_argv().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
2025-02-04 10:28:19 +08:00
Jonas Ådahl
53ae155e03 gdctl: Show color mode
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +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
2fa0183a95 kms/connector: Add API to check color mode support
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
0f9c9fdc20 monitor-config-manager: Put finding relevant configs into helper
Finding configurations relevant for inspiration when creating a new one
can be useful for finding more things to inherit from previous
configurations than the scale, so put the configuration gathering code
in a helper.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
0f200efc6d monitor-config-manager: Rename helper finding logical monitor
It doesn't get a monitor, but a logical monitor, so name it according to
that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
654d75b841 monitor-config-manager: Fix indentation
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
a38f9c2d48 gpu: Don't include monitor manager header
Doing so pulls in too much, causing potential header include order
conflicts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Jonas Ådahl
bfa0f3e2ab output: Fix include order
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +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
Jonas Ådahl
f1e497acfa monitor: Add API to list supported color modes
Available modes are 'default', which is always added, and BT.2100,
which is added if the BT.2020 color space, and the PQ transfer function,
is supported by the output.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Olivier Fourdan
fc6d79eda9 keybindings: Check modifier masks one by one
Commit 48d070dae changed the logic to compare the modifiers mask as a
whole.

Unfortunately, that does not work with all combinations of modifiers, as
some may not be reported when the ISO_Next_Group key is notified.

Revert to the original logic which is to compare against each modifier
mask individually.

Fixes: commit 48d070dae - keybindings: Check for ISO_Next_Group keysym
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4237>
2025-01-31 12:47:45 +01:00
Olivier Fourdan
48d070dae7 keybindings: Check for ISO_Next_Group keysym
In process_iso_next_group(), we would use try to match mask and keycode
of ISO_Next_Group to tell whether the key combo has been activated.

That works on X11, but not on Wayland with the native backend, because
the keycode does not match.

But we do not need to go all through that burden to match the key combo
we could just use the keysym instead, which would work even when there
is no physical key for ISO_Next_Group.

All we need to do is check whether the symbol is ISO_Next_Group and the
modifier mask matches, which simplifies the code as well.

(Note that we still need to keep the resolved iso_next_group_combo
key combo around because the X11 backend grabs that key combo.)

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3883
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4232>
2025-01-30 16:52:56 +00:00
Jonas Ådahl
839f67f1de tests/monitor-dbus: Test changing configuration
Uses some various combinations of the gdctl commands that configures the
available monitors differently.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
fe79188b58 tests/monitor-test-utils: Add debug log for logical monitor checking
This was helpful when figuring out what logical monitor test data was
wrong.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
1cbfc07df0 tests: Add get state D-Bus test using gdctl
Test is ref test like, with gdctl outputs being compared.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
7a39f05b69 tests/build: Allow passing commandline arguments to tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Carlos Garnacho
4cb3518205 core: Make meta_window_move_resize_internal() truly internal
This function is no longer used anywhere outside MetaWindow code, so
make it no longer declared at the window-private.h header.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:05 +00:00
Carlos Garnacho
d7fdf6d7d3 x11: Avoid meta_window_move_resize_internal()
We are using no	placing	flags, so this is essentially the same
as meta_window_move_resize().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:05 +00:00
Carlos Garnacho
92cbefd863 wayland: Avoid meta_window_move_resize_internal()
We are using no placing flags, so this is essentially the same
as meta_window_move_resize().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:05 +00:00
Carlos Garnacho
4664fce695 core: Rename/repurpose meta_window_resize_frame_with_gravity()
The gravity argument is no longer effective since the previous
commit. Drop the argument, and rename it to "meta_window_resize_frame",
all callers have been updated.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:05 +00:00
Carlos Garnacho
fb49a700a1 core: Drop MetaGravity argument from move_resize_internal() call
Obtain the gravity through the newly added MetaWindow method from the
window being moved/resized.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:05 +00:00
Carlos Garnacho
432e52bad0 core: Drop MetaGravity argument from move_resize_internal() vmethod
The implementations no longer need this argument, so drop it in
favor of meta_window_get_gravity().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:05 +00:00
Carlos Garnacho
33c287e271 wayland: Get gravity through MetaWindow getter
Ignore the gravity argument in the move_resize_internal() vmethod,
and use the window getter to get it. It should be functionally
equivalent, and will eventually replace the argument entirely.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:04 +00:00
Carlos Garnacho
37df41097c wayland: Implement get_gravity() vmethod
Handle here the toplevel drag surface getting nortwest gravity,
and fall back to the default static gravity for everything else.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:04 +00:00
Carlos Garnacho
0eaae111d3 x11: Hook up window gravity in size hints to MetaWindow gravity
Make us prefer the gravity as it happens through grab ops first, then
the gravity as specified by the client.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:04 +00:00
Carlos Garnacho
ca0c6bcd69 core: Set gravity based on grab op during window move/resize ops
We will basically want to follow the gravity as specified by the drag
corner/edge. Hook this up to meta_window_get_gravity().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:04 +00:00
Carlos Garnacho
0928d3ec32 core: Add meta_window_get_gravity() private call
This relies on a class vmethod, so that subclasses can alter
the behavior.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
2025-01-29 12:44:04 +00:00
Sebastian Wick
ef0ff602b5 backends: Only build and use MetaLauncher if we have logind
Fixes: 23c2c0853c ("launcher: Move from backends/native/ to backends/")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3878
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4223>
2025-01-29 10:44:57 +00:00
Sebastian Wick
5152fa142b context/main: Guard logind code behind #ifdef HAVE_LOGIND
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4223>
2025-01-29 10:44:57 +00:00
Sebastian Wick
e7ca9cecea build: Rename have_libsystemd to have_logind
We really only need the logind API which can be provided either by
libsystemd or libelogind.

This also pulls out finding a logind provider from the native backend
only code because we make use of it in the generic backend code as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4223>
2025-01-29 10:44:57 +00:00
Daniel van Vugt
156e1b3c07 tests: Fix "fallabck" typo
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4228>
2025-01-28 00:02:14 +00:00
Sebastian Keller
0d699a74a3 clutter/tests: Remove dead wiki link from README
This page does not seem to have been archived properly when the wiki got
shut down so the link does not work anymore. There is no replacement
page in the handbook either.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4229>
2025-01-27 19:01:43 +01:00
Alessandro Astone
87cc6633a5 tests/cursor: Set cursor theme to Adwaita
The reference images were generated using the Adwaita theme, so make sure that
the test client also draws a cursrom from the Adwaita theme rather than reading the
default theme from the environment.

Ideally the test suite would embed the cursor theme and point XCURSOR_PATH to
it, so that even if the Adwaita icon theme changes in the future the test
wouldn't suddently break; I did not implement this yet.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4225>
2025-01-21 18:23:51 +01:00
Michel Dänzer
a211ed553b onscreen/native: Do not use modifiers if surface should be sharable
Importing a buffer allocated with a modifier into another GPU isn't
handled correctly yet in mutter. We'll want to fix that in the future,
for now just don't use modifiers in this case though, falling back to
GBM_BO_USE_LINEAR, to prevent issues due to mis-matched tiling
parameters.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3791
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4219>
2025-01-17 15:26:02 +00:00
Yao Wei (魏銘廷)
78c621aa1a backends/input-mapper: Synchronize device enabled state when adding device
When device is added to the mapper, the device may not be in a
desirable state. This changeset updates the device state when
the device is added to the input-mapper.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3834
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4188>
2025-01-17 05:27:24 +00:00
Jonas Ådahl
c9d8b0b5a9 screen-cast-stream-src/virtual: Track cursor updates via frame clock
When the cursor is captured via metadata, schedule updates when the
sprite changes or position moves, so we can gather the cursor change
during dispatch.

Also use the new skipped-paint stage watch to avoid having to guess
whether something will be painted by peeking at the pending damage.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Jonas Ådahl
5846061449 stage: Add watch mode for 'skipped' signal
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Jonas Ådahl
57cd2bc4f7 stage: Move N_WATCH_MODES next to the enum
This makes it harder to forget to update.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Jonas Ådahl
127c303254 util: Remove meta_warning()
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00