1
0
Fork 0
Commit graph

32021 commits

Author SHA1 Message Date
Jose Riha
a27181ff5a Update Slovak translation
(cherry picked from commit 62e559d752)
2024-05-29 20:45:14 +00:00
Scrambled 777
9dbca2efb2 Update Hindi translation 2024-05-28 17:51:34 +00:00
dcz
11a4d56185 keybindings: Send trigger when a key accelerator is deactivated
This is neccessary to support the GlobalShortcuts portal which demands Deactivate events.

https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/47

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3680>
2024-05-28 09:27:39 +00:00
Marco Trevisan (Treviño)
b0df2d0f7d frame: Handle X11 errors earlier on frame setting
Avoid changing the stack information if we fail earlier than that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
e1dbf102dc 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.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
2065214b71 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.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
4eb76b565f frame: Define a free function for MetaFrame and use via autoptr
Use clearer memory management for the MetaFrame making it easier
to destroy it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
5b1c0c2123 stack-tracker: Improve documentation why we need to filter x11 windows
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
c202662ca3 stack-tracker: Improve logging when an operation is ignored
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
0653b829c1 stack-tracker: Avoid multiple casts to Window type
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3732>
2024-05-27 16:23:20 +00:00
Marco Trevisan (Treviño)
e3d3b257ae window-private: Actually remove frame instance
As per GNOME/mutter!3254 MetaFrame is part of MetaWindowX11Private, but
MetaWindow has still the frame field.

Drop it since it's unused now and can lead to confusion

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3784>
2024-05-27 17:11:55 +02:00
Bilal Elmoussaoui
0f19c6f5b6 window: Stop caching frame_bounds
That was only there to force updating MetaFrame's bounds
but that is something that is already updated in
MetaWindowX11.move_resize_internal. So just drop all of that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
d1b04ffb55 window: Move frame_bounds to WindowX11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
bcb069f454 window: Move frame field to WindowX11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
503c70e284 window: Replace get_titlebar usages
Uses the hardcoded value that was used for wayland
clients for x11 ones as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
70f8cc433e window: Move get_session_geometry to WindowX11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
751ef5abd2 window/x11: Add a is_ssd helper
Would be useful for moving frame field to WindowX11 in the upcoming commits

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
fff528cbf1 window: Remove shove titlebar onscreen functions
Mutter side of
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3332

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
acbb14f34b window: Move has_custom_frame_extents to WindowX11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
b4b896d4db core: Move frame related types to x11
Also rename the files to meta-x11-frame* for consistency

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Georges Basile Stavracas Neto
06dde49d12 cogl/renderer: Remove dead code
Introduced by dad9f64b5f, but wasn't caught on review.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3782>
2024-05-27 10:29:10 +02:00
Bilal Elmoussaoui
b054a09aa1 cogl: Remove unnused Renderer.foreach_output
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3781>
2024-05-26 16:12:48 +02:00
Bilal Elmoussaoui
c506c194b6 cogl: Don't allow overriding renderer winsys_id
It is an API that no longer makes sense, as Cogl is only usable inside of Mutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3781>
2024-05-26 16:11:47 +02:00
Bilal Elmoussaoui
dad9f64b5f cogl: Don't allow overriding renderer constraints
It is an API that no longer makes sense, as Cogl is only usable inside of Mutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3781>
2024-05-26 16:10:21 +02:00
Philip Withnall
1b64353427 dbus-interfaces: Add some docs to the IdleMonitor interface
They’re not complete, but they’re something.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3768>
2024-05-26 10:04:19 +00:00
Philip Withnall
173332e928 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>
2024-05-26 09:19:17 +00:00
Philip Withnall
ca1434ff1e 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>
2024-05-26 09:19:17 +00:00
Florian Müllner
a66dab9273 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>
2024-05-24 20:55:23 +00:00
Florian Müllner
bcfbc7fa17 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>
2024-05-24 20:55:23 +00:00
Bilal Elmoussaoui
42c534a02f build: Don't error out if startup_notification is enabled but not x11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3765>
2024-05-24 13:16:16 +00:00
Bilal Elmoussaoui
bb38601d0f build: Don't check for sm dependency if x11 is disabled
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3765>
2024-05-24 13:16:16 +00:00
Bilal Elmoussaoui
7f213c2a2f x11: Use the embedded xcursor functions where possible
Makes those functions that are intended to be used in wayland-only
builds to be tested in x11 code paths as well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3607>
2024-05-24 13:02:42 +00:00
Bilal Elmoussaoui
0a46ca67ec core: Include a small subset of xcursor in-tree
For a Wayland only build, we would like to avoid linking against
libXcursor which on it turn, links back to some of the X11 deps.
In order to achieve that, we include a small subset of xcursor.

In case Mutter is built with X11 or with both Wayland & X11, we link
against libXcursor and don't make use of the in-tree implementation.

This patch mimics what GTK 4 do by shipping an in-tree copy of xcursor.
Especially that libwayland-cursor does not provide an alternative to
xcursor itself.

Helps #2272

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3607>
2024-05-24 13:02:42 +00:00
Sebastian Keller
650ef9b57f 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>
2024-05-23 22:34:19 +00:00
Sebastian Keller
c3e626405f 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>
2024-05-23 22:34:19 +00:00
Sebastian Keller
d4907a960c 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>
2024-05-23 22:34:19 +00:00
Sebastian Keller
d686865918 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>
2024-05-23 22:34:19 +00:00
Sebastian Keller
c0537096c2 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>
2024-05-23 22:34:19 +00:00
Jonas Dreßler
79a79b3450 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>
2024-05-23 20:24:13 +00:00
Jonas Ådahl
6b3a289ab5 wayland/drm-syncobj: Check for sync-fd cogl feature
The syncobj implementation uses cogl_context_get_latest_sync_fd(), so
check that that function will actually work.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3475
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3771>
2024-05-23 16:42:21 +00:00
Jonas Ådahl
c192f51159 cogl: Add sync fd feature enum value
This is meant to tell whether cogl_context_get_latest_sync_fd() is
supposed to work or not. It's enabled when ANDROID_native_fence_sync is
exposed by the driver.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3771>
2024-05-23 16:42:21 +00:00
Carlos Garnacho
69e791cda1 wayland: Implement the XDG dialog protocol
This protocol takes over some of our homegrown GTK Shell
protocol, allowing to specify hints on surfaces such as
dialog modality.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3557>
2024-05-22 10:42:20 +00:00
Carlos Garnacho
326e4c15de ci: Bump base image and wayland-protocols dependency
Build wayland-protocols 1.36 for xdg-dialog support.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3557>
2024-05-22 10:42:20 +00:00
Michel Dänzer
8a862b102c kms/impl-device: Inhibit real-time scheduling when querying KMS state
On some setups, the kernel may keep the KMS thread busy for significant
amounts of time while querying KMS state, which could result in mutter
getting killed by the kernel, e.g. after hot-plugging displays.

Issue: https://gitlab.gnome.org/GNOME/mutter/-/issues/3479
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3763>
2024-05-22 08:49:29 +00:00
Michel Dänzer
be4bf8da9c wayland/surface: Keep applied sub-surface branch node linked up
Until this surface or its parent is finalized.

This makes sure that any `MetaWaylandSubsurfacePlacementOp` referencing
this surface for sibling will be applied as intended.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3737>
2024-05-21 16:23:59 +00:00
Michel Dänzer
5749810ddb Revert "wayland/subsurface: Drop unapplied subsurface state on unmap"
This reverts commit 35d92e0fac.

This turned out to cause trouble, because it can prevent
MetaWaylandSurface::applied_state.subsurface_branch_node from ever
getting linked up for a sub-surface.

It shouldn't be necessary anyway, since permanently_unmap_subsurface /
wl_subcompositor_get_subsurface reset the sub-surface state as defined
by the protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3737>
2024-05-21 16:23:59 +00:00
Michel Dänzer
ad22833cc3 wayland/subsurface: Hold surface reference in placement ops
Will be necessary with the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3737>
2024-05-21 16:23:59 +00:00
Michel Dänzer
ba93fcd30f wayland/subsurface: Make sure siblings are actually sub-surfaces
Without this check, is_sibling could spuriously return TRUE when neither
surface passed in was actually a sub-surface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3737>
2024-05-21 16:23:59 +00:00
Sebastian Wick
08c9a775e7 tests: Make sure XDG_CURRENT_DESKTOP is unset
GSettings overrides can be active and set the default value depending on
the XDG_CURRENT_DESKTOP environement variable. For the tests we run, we
rely on the default settings by using the GSettings memory backend but
we also need to make sure not overrides are in place.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3730>
2024-05-21 12:16:06 +00:00
Sebastian Wick
301c154f02 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>
2024-05-21 12:16:06 +00:00