1
0
Fork 0
Commit graph

32690 commits

Author SHA1 Message Date
Michel Dänzer
041a404ba0 wayland/actor-surface: Don't bail for Xwayland surfaces
Thawing Xwayland surfaces don't hit meta_window_actor_wayland_set_frozen,
so we need to sync actor state for them here.

v2:
* Guard META_IS_XWAYLAND_SURFACE by HAVE_XWAYLAND, fixes Wayland-only
  build.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3557
Fixes: ec5444f541 ("wayland/actor-surface: Don't sync actor state for frozen actors")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3862>
2024-07-02 19:39:27 +02:00
Michel Dänzer
92d60dbb08 backend/native: Define struct drm_plane_size_hint only if libdrm doesn't
Fixes error building against libdrm >= 2.4.122:

../src/backends/native/meta-kms-plane.c:67:8: error: redefinition of ‘struct drm_plane_size_hint’
   67 | struct drm_plane_size_hint {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/libdrm/drm.h:1025,
                 from /usr/local/include/xf86drm.h:40,
                 from ../src/backends/native/meta-kms-plane-private.h:20,
                 from ../src/backends/native/meta-kms-plane.c:21:
/usr/local/include/libdrm/drm_mode.h:866:8: note: originally defined here
  866 | struct drm_plane_size_hint {
      |        ^~~~~~~~~~~~~~~~~~~

Suggested by Jonas Ådahl.

v2:
* Use has_type. (Sebastian Wick)

v3: (jadahl)
* Bump meson requirement to 1.3.0 for compiler.has_type()

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3556
Fixes: 0ca933baec ("backend/native: Adds support for SIZE_HINTS Cursor Plane Property")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3848>
2024-07-02 14:09:21 +00:00
Carlos Garnacho
a1191c405d wayland: Remove dead code
This code is called from handlers connected to signals of a
MetaWindow. It cannot happen that the window will end up NULL
in these, so exchange with a g_assert() as we in fact expect
it to be non-NULL.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3860>
2024-07-02 13:26:01 +02:00
Carlos Garnacho
949eb8b638 wayland: Use separate signal handlers to track pending activations
We cannot use a function with the same signature for signals with different
arguments, if we want to rely on the user data parameter. Separate into
two signal handlers calling the same function inside.

Fixes: b9ba34ac6f ("wayland/activation: Fix signal callback signature")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3860>
2024-07-02 13:26:01 +02:00
Florian Müllner
ddef77340e
Bump version to 47.alpha
Update NEWS.
2024-06-30 16:20:17 +02:00
Bilal Elmoussaoui
6712edab1c build: Remove no longer used dbus dependency
It was used to get the interfaces directory when building with profiler enabled

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:09:00 +02:00
Bilal Elmoussaoui
bfd7f9d549 build: Split X11 server & client dependencies
Allows xwayland=true x11=false to be built with less dependencies
Also removes some unused x11 dependencies on the frame client & cogl

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:09:00 +02:00
Bilal Elmoussaoui
a172c0f0dd clutter: Remove uneeded dependencies
Clutter doesn't interact with x11/wayland/libwacom directly

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:09:00 +02:00
Bilal Elmoussaoui
decf43d3b4 tests: Add missing wayland-client dependency
It was pulled indirectly from clutter, see next commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:09:00 +02:00
Bilal Elmoussaoui
e52e38d8fb ci: Add a Xwayland without x11 job
As we expect various distros to switch to this build in the future,
having a CI test build for it would ensure things keep working as
expected

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:09:00 +02:00
Bilal Elmoussaoui
820a7ad813 build: Allow building xwayland without x11
Co-authored-by: Jonas Ådahl <jadahl@gmail.com>
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3553

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:08:55 +02:00
Corentin Noël
4134d12789 meta/plugin: Annotate dialog creation virtuals as return full
The two dialog creation virtual functions returned by these functions have to
be unreferenced by the caller (and are actually unreferenced in other places in
the code).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3790>
2024-06-29 12:04:31 +00:00
Carlos Garnacho
01444e803f clutter: Specify that input-only grabs are started inactive in API
Add the _inactive suffix, so that the state of these objects is clear.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3747>
2024-06-28 22:49:45 +00:00
Carlos Garnacho
8e5f3a1f83 clutter: Add API to create inactive ClutterGrabs, and activate them explicitly
This gives greater control to the callers on the place where a grab is being
activated, this may make a difference in the handling of crossing events
triggered through it, e.g. by having callers rely on having already obtained
a ClutterGrab prior to handling the resulting effects.

The "input only" grab has also been turned inactive by default, in order to
to have the ClutterGrab pointer available for checks at the MetaWaylandEventHandler
focus changing methods triggered through grab activation.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3463
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3747>
2024-06-28 22:49:45 +00:00
Jeffrey Knockel
5ba364a947 constraints: Allow resize of windows moved above screen
If the titlebar of a window has been moved above the screen by a user
via an unconstrained move, then any constrained user resize following
this move will cause the window to jump below the top of the screen or
cause other glitchy behavior.

This commit removes the constraint that the titlebar of a window must be
below the top of the screen for any resize that is both (1) triggered by
a user and (2) is a resize that affects only the left, right, or bottom
edges of the window.  This allows users to move a window partially above
the screen and then resize the window to be wider or resize the bottom
edge of the window to make it taller or shorter.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1206
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3764>
2024-06-28 20:49:10 +00:00
Shiki Okasaka
4b1411696e clutter: Use character offsets for specifying the surrounding text
clutter_input_focus_set_surrounding() expects cursor and anchor positions
to be provided in character offsets.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3440
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3719>
2024-06-28 19:25:48 +00:00
Jonas Ådahl
fbab46c880 display: Fix fallback MetaX11Display typedef
It was missing a _.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3851>
2024-06-28 18:51:10 +00:00
Jonas Ådahl
ae0b8a71dc x11-keybindings: Include config.h
This unbreaks building here. The compilation error was due to
MetaX11Display having an incorrect typedef in a now preprocessed out
part, which will be fixed in a later commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3851>
2024-06-28 18:51:10 +00:00
Orko Garai
f214eb5134 Use byte offset for cursor_end/anchor value sent in preedit_string.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3845>
2024-06-28 17:23:30 +00:00
Michel Dänzer
94f3bbd94b wayland/surface: Can't send scale events with NULL surface->resource
The committed state can't have any children sub-surfaces either, so
just bail.

Fixes: ae403f2e94 ("wayland: Use new highest scale monitor tracking for fractional_scale_v1")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3552

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3849>
2024-06-28 16:17:05 +02:00
Bilal Elmoussaoui
b6fb8d87f4 x11/display: Keep track of stage input region
It makes more sense for Mutter to track that instead of gnome-shell
allowing gnome-shell to no longer have an ifdefed struct field

Context:
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3362#note_2151381

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
fd9957b81a keybindings: Move X11 bits to a separate header
Reduces the noise in terms of ifdef and makes it much easier
to spot which X11 bits are still mixed in the generic
keybindings file

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
beae45a060 build: Expose some features as variables in pkgconfig
Allows gnome-shell or other compositors to detect which features
were built when building libmutter automatically without having to
expose various build options themselves

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
5a6b0fcee3 build: Conditionally include xlib libraries for Meta gir file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
0ff6afab2a ci: Disable X11 for Wayland-only builds
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
7c41468ba3 build: Add a X11 option
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
831b563a3c context/main: Disable X11 specific arguments
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
08a3c57aad build: Only install group.h header when built with x11
Also rename the header to file to be consistent with other x11-only
headers

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
c8ba4f1cda x11/group: Make various functions private
Nothing uses them and they are X11 only

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
f7131b2b2f keybindings: Guard X11 calls
This is absolutely not a great commit. As the keybindings could use a
decent
refactoring, see https://gitlab.gnome.org/GNOME/mutter/-/issues/3363 for
more details.
And as this is the last remaining item in getting a wayland-only build,
I think
it is a good 'comporomise' for the time being and makes it clear which
bits of code are
used in x11-only code paths.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
33d490f472 stack-tracker: Add missing headers includes
Required when building without x11

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
0814d5029d x11: Introduce a meta-x11-types header
Used to define x11 only types. Future commits will introduce
a way for compositors to detect if they can use x11 features or not

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
50058b79d1 x11: Don't expose MetaFrame type
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Sebastian Wick
6ee7c2da7c tests/stacking: Do not wait after move action
Moving a window is a compositor action and happens immediately. Waiting
here is pointless. Make sure instead that the action happens immediately
by asserting the position.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3842>
2024-06-27 14:00:02 +00:00
Sebastian Wick
4e82896533 tests/stacking: Use wait_size for resizes
wait and wait_configure after a single resize is useless and a race.
Resize is a client side action which doesn't result in a configure and a
wait doesn't sync for a resize as well.

Sometimes the resize is paired with another action, such as maximize,
fullscreen or show. In those cases a configure will be generated and a
previous resize is accounted for.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3842>
2024-06-27 14:00:02 +00:00
Sebastian Wick
be46852292 wayland/dnd-surface: Chain up in the assigned vfunc
Commit e775052429 changed the code such that resetting the actor is done
when a surface role is assigned. The dnd surface assigned vfunc doesn't
chain up which means the code to reset the actor is never hit and the
dnd surface never shows up.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3540
Fixes: e775052429 ("wayland/actor-surface: Reset the actor on role-assignment")
2024-06-26 18:37:34 +00:00
Jonas Ådahl
0c014a23b4 doc/coding-style: Update guidelines for floating point numbers
The old guidelines aren't compatible with -Wfloat-conversion.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3822>
2024-06-25 20:48:24 +02:00
Jonas Ådahl
422ee4515d Compile with -Wfloat-conversion
This means we'll get warnings whenever a floating point value looses
precision, e.g. gets implicitly casted to an integer. It also warns when
implicitly casting double's to float's, which arguably is less of a
problem, but there are no warning for just float/double to int.

This would have caught
https://gitlab.gnome.org/GNOME/mutter/-/issues/3530.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3822>
2024-06-25 20:48:24 +02:00
Jonas Ådahl
d5bc883712 clutter/paint-nodes: Remove radius field from blur node
It wasn't used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3822>
2024-06-25 20:45:27 +02:00
Michel Dänzer
fab78d951a 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>
2024-06-25 13:35:46 +00:00
Michel Dänzer
03f3c18d27 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>
2024-06-25 13:35:46 +00:00
Carlos Garnacho
a48a149c61 backends: Use floating point checks in MetaViewportInfo
In these checks, it's an important detail to preserve subpixel information
in order to correctly determine whether the coordinates are inside or
outside a view.

Otherwise, small enough motion towards the left/top might get rounded
to 0, be seen as "inside the view", and the pointer coordinates be allowed
to escape the viewport constraints.

This was figured out by Pascal Nowack before me, with a difference of
minutes. Credit where credit is due.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3530
Fixes: 6c972546f1 ("mtk: Add Rectangle.contains_point")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3820>
2024-06-25 01:44:30 +02:00
Carlos Garnacho
32cb2ee720 mtk: Add mtk_rectangle_contains_pointf()
This variant works on floating point coordinates, in order
to avoid undesired effects with rounding.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3820>
2024-06-25 01:44:30 +02:00
Georges Basile Stavracas Neto
de2aac7a3d src/seat-impl: Keep device variable alive for longer
In meta_seat_impl_remove_virtual_input_device(), the 'device'
variable is first removed from MetaSeatImpl, then a "device
removed" event is generated with it.

The problem here is that, if this is the last reference of
'device', the removal from MetaSeatImpl will destroy it. Then
the freed variable will be used to create the "device removed"
event, which is a use-after-free situation.

Fix that by owning an extra ref to 'device' as long as the
function is executing. Do this by declaring a g_autoptr
variable with the extra ref. This g_autoptr variable is cleaned
up by the end of the function, which achieves the desired effect.

Spotted by Coverity.

CID: #1594046
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3835>
2024-06-24 12:04:08 +00:00
Bilal Elmoussaoui
cb4b31f858 clutter: Don't generate unused keys_by_name table
Spotted by codeql

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3837>
2024-06-22 23:53:49 +00:00
Bilal Elmoussaoui
43dabfc8d1 clutter: Remove unused static function
Detected through codeql

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3837>
2024-06-22 23:53:49 +00:00
Bilal Elmoussaoui
6e1c761330 Remove unused variables
Detected through codeql

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3837>
2024-06-22 23:53:49 +00:00
Florian Müllner
42e5c7bd9c Bump API version
It has been a while since we branched, and there have been enough
divergence already to justify a bump.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3836>
2024-06-22 15:01:25 +02:00
Michel Dänzer
eb8c2f600a kms/impl-device: Use priv->path in _open_non_privileged_fd
This can work even if priv->device_file == NULL, e.g. with a secondary
GPU with no displays connected.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3833>
2024-06-21 21:39:41 +00:00
Sebastian Wick
4eacf97678 wayland/surface: Send unmapped signal when the surface goes away
This was the intention anwyway but it didn't work properly because
GObject::dispose removes all signal handlers and we unmap surfaces in
WaylandShellSurface::finalize. Move all the unmanaging and unmapping to
the dispose vfunc where we can still run all the signal handlers.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3501
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3783>
2024-06-21 22:07:45 +02:00