1
0
Fork 0
Commit graph

31960 commits

Author SHA1 Message Date
Daniel van Vugt
1d7c2c7b61 x11: Add another fallback to legacy X11 cursor names
For X11 apps that don't specify their own.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3403
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 807c99fca6)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
d2d98a850c backends: Restore support for loading X11 cursor themes missing "default"
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3184
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit d2c6b77059)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
f744efe347 backends: Add meta_cursor_get_legacy_name()
To aid loading of legacy cursor themes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 4a4ab8c533)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
234013961e backends: Fix parameter alignment check-code-style complains about
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 13b2803a03)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
c1f03eba73 backends/x11: Avoid defining (and freeing!) nonexistent cursors
Such as "default" for legacy X11 themes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3454
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 847f015017)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
df93ce4524 tests: Mark some tests as skippable
Wayland tests also get kvm and tty test variants, but running tty tests
on your main session makes them fail. The intention for tty tests is to
skip when not run from a tty, so fix that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3811>
(cherry picked from commit 6d8c93ba66)
2024-06-28 21:18:01 +02:00
José Expósito
88f5fb3447 backends/eis-client: Release buttons on device remove
Due to a copy and paste error, buttons were not released when the device
was removed.

Found by Coverity.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3809>
(cherry picked from commit 4ae305f19e)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
a193da6d97 kms: Don't use kernel thread when headless
We're not doing anything significant in the KMS thread anyway, so don't
make it a kernel thread, and don't ask to be real time scheduled (which
we wouldn't be anyway, but for clarity).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3805>
(cherry picked from commit 5bca761148)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
80d1b79849 backend/native: Find render node directly via udev
Don't try to find the card, and then the render node from it, just ask
udev to list the render nodes directly. This avoids running into
permission errors when the user cannot open /dev/dri/card* even without
mode setting capabilities.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3805>
(cherry picked from commit 6bd2fd6a74)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
e1efc4c64e wayland: Double check surface/window before looking for modals
While it should not be expected that we pick the pointer into a
MetaSurfaceActor that is disembodied of its MetaWaylandSurface/MetaWindow,
the paths where this should be enforced are somewhat scattered.

So account for the situation in picking code, and prefer a NULL surface
over a crash. This operates on the assumption that this inconsistent state
where Mutter didn't know better to pick a correct surface actor will be fixed
by later crossing events resolving the intermediate state, and that no
other input events will be received meanwhile.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3393
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
(cherry picked from commit e731f2a055)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
2f4dc03451 wayland: Make subsurface actors unreactive early during destruction
When unmapping a subsurface, it does lose early its connection to the
parent surface. This is however a deciding factor in determining whether
the surface (role) has a window.

Make the subsurface actor unreactive if its connection to the parent
MetaWindow was severed, since it should not be eligible for picking anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
(cherry picked from commit 66e23b009c)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
523d716e63 compositor: Make surface actors unreactive after losing their surface
These actors are expected to be destroyed along with their surface, this
however happens later in the process, so there is a moment where actors
are eligible for picking, but do not have a surface anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
(cherry picked from commit 17dc9393e0)
2024-06-28 21:18:01 +02:00
Sebastian Keller
feec993dee events: Don't check for stage grabs before sending events to ibus
Prior to the grabs/focus rework in !3420, Wayland grabs were handled
separately from ClutterGrabs. This required explicitly checking for
ClutterGrabs as those were expected to prevent events from reaching
Wayland clients.

Now after !3420, Wayland client grabs also result in ClutterGrabs, which
means that this check causes input events for popups with grabs to not
get sent to ibus anymore. Instead the events are getting sent to the
client directly, which results no ibus support in popups (unless the
client handles that itself by using a different GTK_IM_MODULE).

However due to the changes from !3420 checking for ClutterGrabs is also
no longer necessary and the meta_wayland_text_input_update() focus check
is now sufficient to only forward events to ibus, when the focus is
actually on a Wayland client. So to fix this we can simply remove the
check.

Fixes: 2a584a8f0 ("wayland: Make use of Wayland event grabbing mechanism")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3502
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3787>
(cherry picked from commit a99e139a68)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
6aaa76dfc3 Revert "wayland: Add meta_wayland_seat_get_input_focus_client() call"
This reverts commit 743fb6df30.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
(cherry picked from commit ad60d7123b)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
c2dc92a214 wayland: Fix possibly out of sync clipboard selections
Replace the sync_focus() calls with a set_focus() do-it function taking
a surface. This is in line with the rest of the things that happen at
the default MetaWaylandEventInterface.focus implementation, and will
make these correctly observe the presence of grabs, since
meta_wayland_seat_get_input_focus() will return the would-be focus
in these cases.

This change makes the "focused" client selection truly
in sync with the keyboard focus.

Fixes: 5ca10c31d1 ("wayland: Follow seat's input focus client for clipboard selections")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3490
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
(cherry picked from commit b968796f1f)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
73cab26d0f wayland: Fix possibly out of sync primary selections
Replace the sync_focus() calls with a set_focus() do-it function taking
a surface. This is in line with the rest of the things that happen at
the default MetaWaylandEventInterface.focus implementation, and will
make these correctly observe the presence of grabs, since
meta_wayland_seat_get_input_focus() will return the would-be focus
in these cases.

This change makes the "focused" client selection truly
in sync with the keyboard focus.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3498
Fixes: 9bdb00c459 ("wayland: Follow seat's input focus client for primary selections")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
(cherry picked from commit 9dab806a18)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
2fca52fb91 core/context: Add typecheck guards to the public functions
In the shell side we ended up calling the wrong function [1] and mutter
didn't stop us from doing it, so add some type-check guards to ensure we
don't do similar errors again

[1] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3355

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3791>
(cherry picked from commit 467746c8a7)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
6f489292b9 cogl: Do not store the XVisualInfo
We were leaking one instance because _cogl_winsys_egl_context_created()
could be potentially be called twice (via cogl_display_setup() one as
part of cogl_renderer_check_onscreen_template() and the other when
called from clutter_backend_do_real_create_context()), and so we'd ended
up overwriting the reference we had.

However, we really didn't use it anywhere and once used to call the
relevant functions it's just useless.

So let's just keep it as local variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit bcec6df78e)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
fb327dfb4d backends/x11/backend-x11-nested: Cleanup the cursor renderer on dispose
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit 0fda3ab8a1)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
1a93640aa0 backends/input-settings: Clear the devices list on dispose
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit 6a04ea9a59)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
ab86f20c9b backends/backend: Clear egl object if any
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit b630c3baa6)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
95166ea750 backends/color-store: Unify and simplify codepaths for profile ready
Just steal from the hash table all the times, and use autopointers
to cleanup if needed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit de8691c7ff)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
a34b0ce86a backends/color-store: Clarify the color profile ownership fixing the key leak
We were leaking the color profile path keys but also it wasn't clear how
the ownership was passed to the new hash-table, so let's just remove it
from the pending hash table and add it to the new one including the
expected reference.

This is safe because we were still adding a temporary extra ref to the
profile

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit 430e55a535)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
8e652e3562 backends/native/backend-native: Free the device path when stealing the device
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit c2cc26b370)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
f76591fd02 backends/native/thread: Unref the callback sources hashtable on finalize
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit ce1dd40f7b)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
63ff9588a4 backends/remote-access-controller: Own and free the session managers
We were leaking the session managers list, but at this point I feel it
looks cleaner to also own it fully

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit f74a46d98d)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
e975e2c4c9 backends/backend: Cleanup MetaDnd on dispose
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit c33a02dd32)
2024-06-28 21:18:01 +02:00
Philip Withnall
426fcb61be tests: Fix a -Wmaybe-uninitialized warning
Since the `switch` didn’t have a default case, the `cull_front` and
`cull_back` variables could technically be used uninitialised if the
`cull_mode` was unrecognised.

That seems unlikely to happen as presumably other code makes sure the
`cull_mode` is valid, but it doesn’t hurt to add a `default:` case to
squash the compiler warning.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3770>
(cherry picked from commit 173332e928)
2024-06-28 21:18:01 +02:00
Philip Withnall
5f6cf26721 display: Fix a -Wmaybe-uninitialized warning
Depending on whether the input mapper was found, these variables could
indeed be used uninitialised, so this is a true positive warning.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3770>
(cherry picked from commit ca1434ff1e)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
2ea002c0df Revert "window/wayland: Use scale for configured rect in configuration"
This caused https://gitlab.gnome.org/GNOME/mutter/-/issues/2616.

This reverts commit 2a62e690a2.
2024-06-27 23:40:09 +02:00
Michel Dänzer
ec5444f541 wayland/actor-surface: Don't sync actor state for frozen actors
This ensures that sub-surfaces remain visible during the fade-out
animation of their window.

Fixes: be4bf8da9c ("wayland/surface: Keep applied sub-surface branch node linked up")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3508
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3840>

(cherry picked from commit fab78d951a)
2024-06-26 13:28:13 +02:00
Michel Dänzer
ce4a22b80f window-actor/wayland: Sync actor state when actor is thawed
This is currently redundant, but will be needed with the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3840>

(cherry picked from commit 03f3c18d27)
2024-06-26 13:27:56 +02:00
Daniel van Vugt
175a4615ad 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

(cherry picked from commit b684b5cf05)
2024-06-25 17:32:25 +08:00
Милош Поповић
485fa00f1a Update Serbian translation 2024-06-20 20:34:10 +00:00
Pawan Chitrakar
fdd48c735e Update Nepali translation 2024-06-19 07:25:24 +00:00
Jonas Ådahl
68a7d6dcfc screen-cast/window: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-16 14:26:41 +02:00
Jonas Ådahl
c7819dbfdc screen-cast/monitor: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-16 14:26:41 +02:00
Jonas Ådahl
c0ad6c8a88 screen-cast/area: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-16 14:26:41 +02:00
Jonas Ådahl
edbdda7cbd screen-cast/virtual: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3220
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-16 14:26:41 +02:00
Jonas Ådahl
33907073ff screen-cast/src: Allow dropping cursor-frame if nothing changed
Allow a screen cast stream source to say that nothing changed in terms
of cursor metadata, and treat this together with a cursor-only frame as
we not recording anything.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-16 14:26:41 +02:00
Jonas Ådahl
90aee21f20 clutter/frame-clock: Only update immediately after idle if vsynced
If the presentation time isn't known, e.g. if the monitor is virtual and
the actual presentation happens far away, the presentation time we
actually received tends to be the time a frame was presented to the next
layer, meaning practically immediately after painting.

When scheduling another update after that, don't assume that if the next
calculated update is not the immediate next update, schedule an update
sooner, as that will in such cases always be true, meaning we ended up
busy looping with constant frame updates being scheduled.

Fix this by only triggering that logic if the last presentation time was
actually vsync:ed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-16 14:26:41 +02:00
Jose Riha
62e559d752 Update Slovak translation 2024-05-29 20:45:08 +00:00
Scrambled 777
84d6a8c9ca Update Hindi translation 2024-05-28 16:49:22 +00:00
Marco Trevisan (Treviño)
24e6843ab7 frame: Handle X11 errors earlier on frame setting
Avoid changing the stack information if we fail earlier than that
2024-05-27 17:21:10 +02:00
Marco Trevisan (Treviño)
1e02c06298 frame: Handle reparent failure avoiding duplicate stack windows instances
In some cases, reparenting a window with its frame may fail; this seems
to happen especially during initialization of a window that may be
unmapped and re-mapped quickly and multiple times.

If this happens, we're never going to receive a remove event on the
stack tracker and so we may end up adding it twice to the list of the
windows to synchronize with the compositor, breaking its assumption that
the stack list is unique, and eventually leading to a crash because we
do not end up removing all the instances of a window on its destruction.

In particular we may end up in this situation:

  Syncing Window 10485927: 0x555558863540 (actual xid is 10485927),
    user time is 10485928 frame is 0x5555588715c0, frame xid 6291591
  Syncing Window 14680081: 0x5555588664b0 (actual xid is 14680081),
    user time is 14680082 frame is 0x555558871d80, frame xid 6291595
  Syncing Window 6291460: 0x55555796dc80 (actual xid is 10485763),
    user time is 10485764 frame is 0x555557a6f630, frame xid 6291460
  Syncing Window 6291465: 0x555557a68af0 (actual xid is 14680067),
    user time is 14680068 frame is 0x555557a73e80, frame xid 6291465
  Syncing Window 6291509: 0x555557f9d830 (actual xid is 8388623),
    user time is 0 frame is 0x555557fac780, frame xid 6291509
  Syncing Window 6291586: 0x5555586e1690 (actual xid is 4194363),
    user time is 0 frame is 0x55555886e550, frame xid 6291586
  Syncing Window 6291591: 0x555558863540 (actual xid is 10485927),
    user time is 10485928 frame is 0x5555588715c0, frame xid 6291591

Where the same meta window 0x555558863540 is added twice because that's
both mapped by the window itself (10485927) and by its frame (6291591).

This happens because for historical reasons the xids hash table managed
by the x11-display maps both the X11 windows, their frames and their
user time windows as the meta-window, and so if we don't filter out them
properly we end up duplicating the entries in the compositor list.

Such duplicates finally end up making mutter to crash in
meta_compositor_sync_stack() because we could end up trying to access
to an invalid window, given its actor has been destroyed but not all the
instances have been removed from the compositor windows list:

  0x00007ffff71059 in meta_compositor_sync_stack (compositor=0x555555b8,
  stack=0x555558701b80) at ../../mutter/src/compositor/compositor.c:773
  773	          if ((old_window->hidden || old_window->unmanaging) &&
  (gdb) print old_window
  $1 = (MetaWindow *) 0x0

So, in order to prevent this, check that XReparentWindow does not fail,
and in case of failure, reset the window state to the one it had before
we failed and more importantly, remove the association between the frame
X11 window and the MetaWindow, since this is not true anymore and so
that at the next stack synchronization there won't be any meta window
associated to that frame XID (unless there aren't further stack changes
impacting on that). Without this we would have instead waited for the
remove event that we predicted, but that could never happen because no
ReparentNotify is emitted in such case.
2024-05-27 17:21:10 +02:00
Marco Trevisan (Treviño)
bd799b6b36 frame: Associate the frame to the window after reparenting
Since we listen the X events in the same thread, and they are delivered
through the main loop, there's not any need to set the frame details on
windows before the reparent operation, because such action could fail.

So move the code order, as preparation for handling the error.
2024-05-27 17:21:10 +02:00
Marco Trevisan (Treviño)
bcc209bf73 frame: Define a free function for MetaFrame and use via autoptr
Use clearer memory management for the MetaFrame making it easier
to destroy it.
2024-05-27 17:21:10 +02:00
Florian Müllner
0205041485
Bump version to 46.2
Update NEWS.
2024-05-25 18:33:22 +02:00
Florian Müllner
313b0ffa19
ci: Hook up release-module
In the future, the module will automate uploading the release
tarball. We already use the CI pipeline to generate the tarball,
so it's easy to hook up the module and provide some testing
before the module goes into production.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3775>
(cherry picked from commit a66dab9273)
2024-05-25 17:04:46 +02:00
Florian Müllner
bfa4522a90
ci: Use meson introspect to generate artifact path
We currently assume that the `CI_COMMIT_TAG` variable matches the
version component of the generated dist tarball.

That is usually correct, but sometimes errors happen and a wrong
tag is pushed, and the real release uses something like "46.0-real".

Account for that by building the artifact path from `meson introspect`
and exporting it as environment variable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3775>
(cherry picked from commit bcfbc7fa17)
2024-05-25 17:04:46 +02:00