1
0
Fork 0
Commit graph

31888 commits

Author SHA1 Message Date
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
Sebastian Keller
5a5a506f57 wayland/pointer-constraints: Don't steal regions for new constraints
meta_pointer_constraint_new() does not take ownership of the passed
regions but instead creates a copy, resulting in a leak in the calling
functions.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3749>
(cherry picked from commit 650ef9b57f)
2024-05-24 09:34:01 +02:00
Sebastian Keller
e466a1bccc wayland/pointer-constraints: Disconnect focus surface handler early
When meta_wayland_pointer_constraint_remove() is called, it can trigger
a meta_wayland_event_handler_invalidate_focus() via:

meta_wayland_pointer_constraint_destroy()
meta_wayland_pointer_constraint_disable()
meta_wayland_input_detach_event_handler()
meta_wayland_input_invalidate_all_focus()
meta_wayland_event_handler_invalidate_focus()

Which then would result in a "focus-surface-changed" signal which would
call meta_wayland_pointer_constraint_remove() a second time. This
happens after surface_remove_pointer_constraints() has already been
called in the first meta_wayland_pointer_constraint_remove() call,
leading to "data" being NULL.

To prevent this issue disconnect the signal handler before calling
meta_wayland_pointer_constraint_disable() when destroying a constraint.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3476
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3749>
(cherry picked from commit c3e626405f)
2024-05-24 09:34:01 +02:00
Sebastian Keller
eff6e48200 pointer-constraints/native: Fix typo in function name
The vfunc is named "constrain" not "constraint".

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3749>
(cherry picked from commit d4907a960c)
2024-05-24 09:34:01 +02:00
Sebastian Keller
e14bd837e1 pointer-constraints/native: Warp locked pointer to correct position
In case of empty regions (e.g. when locking the pointer) the pointer
was only forced to stay within the boundaries of its current pixel
(i.e. culling subpixel position), instead of the position where the
pointer lock did start.

Fixes: 07d24fe50 ("backends/native: Allow infinitely small pointer constraint regions")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3749>
(cherry picked from commit d686865918)
2024-05-24 09:34:01 +02:00
Sebastian Keller
6a2e8e43a7 pointer-constraints/native: Consider origin when checking constraints
Since 07d24fe50 regions are not translated to their on-screen
coordinates anymore, but are relative to the origin stored in the
constraint. This origin however was not considered when checking whether
the pointer was within the constraint region. This meant that the
constraint region would appear to always be placed at 0,0 instead of on
the surface.

Fix this by using the cursor position relative to the origin.

Fixes: 07d24fe50 ("backends/native: Allow infinitely small pointer constraint regions")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3409
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3749>
(cherry picked from commit c0537096c2)
2024-05-24 09:34:01 +02:00
Jonas Dreßler
9db8609623 wayland/popup: Only close popups if press count drops from 1 to 0
We close wayland popups when a button or touch release happens outside
of the grab, except we don't want to close them when that button release is
actually the release of the press that was opening the grab in the first
place.

We never see the press event that opened the grab, so the first event we
see is actually always a release. Make sure to not close the popup on that
event, and instead only close the popup if we see the press count drop from
1 to 0.

This fixes a bug where popup would close right after they open. To
reproduce, click to open a popup, hold pressed and move the cursor over
shell chrome, then release. Or alternatively test with a popup that gets
opened with a long-press gesture (eg. long touch long press on libadwaita
tabs), just doing the touch long-press and then release.

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


(cherry picked from commit 79a79b3450)
2024-05-23 22:02:33 +00:00
Sebastian Wick
044ac90378 tests/wayland-unit-tests: Make sure there are two workspaces
because we want to switch between two workspaces. In some configurations
there is only a single workspace at this point so trying to get current
workspace + 1 gets us a NULL pointer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3730>
(cherry picked from commit 301c154f02)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
ae863e3e26 wayland/xdg-shell: Update min/max window size also on geometry changes
The internal representation of the min/max width of windows include what
is outside of the window geometry, so when the window geometry changes,
but the min/max size did not in the same commit, we'd be left with an
out of date min/max size, potentially causing windows to shrink when
configured.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3755>
(cherry picked from commit 97af5f8705)
2024-05-23 20:24:34 +00:00
Bilal Elmoussaoui
d9a4a5fcb2 Use gboolean consts instead of C bools
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3748>
(cherry picked from commit c13956fb9e)
2024-05-23 20:24:34 +00:00
Sebastian Keller
b34fbc3120 egl: Don't free source error after propagating it
local_error in meta_egl_query_device_string() is using g_autoptr,
meaning that it was getting freed after g_propagate_error(). This then
would result in error->message becoming invalid, causing crashes when
logging the error message later on.

Fixes: 8234f5bc7 ("egl: Return success status from meta_egl_query_device_string")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3758>
(cherry picked from commit 7a38e12ed0)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
d3a73d1a2d ci: Create artifacts of meson logs in dist job
Tests sometimes fail there, but without logs it's hard to know why.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3754>
(cherry picked from commit eaf69fdea8)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
dd735cde01 dbusmock/mocks-manager: Don't create a pipe for started templates
Just shovel the data through our own stdin/stdout, which will end up at
the right place (e.g. /dev/null).

This should hopefully solve `mutter-dist` failing due to a D-Bus method
call timeout in CI.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3757>
(cherry picked from commit e2e687c9db)
2024-05-23 20:24:34 +00:00
Corentin Noël
436541f6e2 clutter/transition: Do not call methods of a NULL ClutterAnimatable
Only call clutter_animatable_get_actor on a non-null object, otherwise set
the timeline actor to NULL directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3750>
(cherry picked from commit 0ab5ff6eed)
2024-05-23 20:24:34 +00:00
Sebastian Keller
d8af06fe49 x11/window: Compare input shape to client rect when undecorating
When a window with an input shape on its decoration window becomes
undecorated and meta_window_x11_update_input_region() gets called via
notify::decorated, the buffer_rect of the window has not been updated
yet while the decorated property has. This would lead to us comparing
the input shape of the client window to the buffer_rect which still
includes the decoration window. This would fail to detect the common
case when the client window has no input shape set, leading to the input
region being set to the size of the client window rather than NULL. If
the window is then resized later, the input shape would remain at the
previous size.

This was not a problem before 6bd920b35, because then we were (wrongly)
always comparing to the client_rect.

Fix this by choosing the correct rect for comparison depending on
whether the window is decorated.

Fixes: 6bd920b35 ("x11/window: Use correct bounding rect to determine NULL input region")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3451
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3720>
(cherry picked from commit 1f1538be76)
2024-05-23 20:24:34 +00:00
Florian Müllner
7562231e2f core/anonymous-file: Support 0-sized files
There is nothing to allocate for a 0-sized files, and indeed
posix_fallocate() will error out if the passed len isn't greater
than 0.

Now that anonymous files are used to back the memory selection
source, this fixes unsetting the selection when the screen is
locked.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3752>
(cherry picked from commit da0bd303ad)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
133a1b2e64 tests: Add test case for keybinding remove race
When a key binding is removed, and a trigger key sequence is dispatched
before the idle callback that resolves and updates the actual binding,
we should handle that gracefully.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3711>
(cherry picked from commit 22f67d107d)
2024-05-23 20:24:34 +00:00
Keyu Tao
93b16a5368 keybindings: Add refcounting to fix use-after-free for key handlers
Two new fields: ref_count and removed, are added to MetaKeyHandler, and
it would be freed only if the ref count has reached 0. When handler is
removed from key_handlers GHashTable, key_handler_destroy() would mark
removed as TRUE, and do an unref. handler->removed is checked in
get_keybinding, and binding with handler removed would not be used.

Also in MetaKeyBinding, it now has the ownership of the name field, to
avoid it being freed before logging. Create or copy a binding would
do a ref inc for handler, and free one would unref handler.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1870.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3711>
(cherry picked from commit 8c39a25459)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
67a7900cd3 window/wayland: Constrain sporadic client resizes immediately
When a client resizes on its own, make sure the new size is passed
through the window constraints machinery directly, to trigger any
potential window management rule that might apply.

Fix a couple of tests to make use of this behavior by introducing a new
'wait_size' command that waits until a window has been resized to a
expected size.

This replaces the fix introduced in 0e736af301 ("window: Ensure
constraints after a Wayland client resize").

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3700>
(cherry picked from commit 57e16cf010)
2024-05-23 20:24:34 +00:00
Sebastian Wick
ba918baa45 window: Start in the activate suspend state until mapped
Starting the timeout to move from hidden to suspended before the window
is mapped means we don't have a previous window configufration which we
need to get the new window configuration with the suspended state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3731>
(cherry picked from commit e509fc7f00)
2024-05-23 20:24:34 +00:00
Sebastian Wick
9a95767865 window: Move implement_showing for the next commit
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3731>
(cherry picked from commit 7a9883d5bb)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
ed637f63c1 tests/wayland: Add test for mapping clone of obstructed window
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3731>
(cherry picked from commit 52d5758f1b)
2024-05-23 20:24:34 +00:00
Jonas Ådahl
2c6993cfb6 tests/wayland: Run with G_MESSAGES_DEBUG=all
Helpful when debugging tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3731>
(cherry picked from commit b69fc15543)
2024-05-23 20:24:34 +00:00