g_unix_fd_list_append() duplicates the provided fd. If that fails, it
returns -1 as fd index and sets - if provided - the passed GError
accordingly.
However, currently, mutter does not check the return value (the fd index
of the appended fd) and thus passes an invalid fd list via dbus to the
remote desktop session user.
Fix this error by also checking the fd index. If the fd index is invalid
(< 0), simply pass the error message of the g_unix_fd_list_append() call
to the caller.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3871>
This reverts commit a3082b8eb3.
We don't find the VKMS device with this commit because it is on seat0
and not on META_BACKEND_TEST_INPUT_SEAT.
The other way around, i.e. returning seat0 in all cases also doesn't
work because *something* hangs if the default seat referrs to the real
seat0 instead of the nonesense META_BACKEND_TEST_INPUT_SEAT.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3869>
mktemp can create a tempfile relative to a directory passed in via -p.
It also uses the $TMPDIR variable for the same purpose. When the
template is specified via -t, $TMPDIR takes precedence over -p. When the
template is specified via a positional argument, -p takes precedence.
Since fec38819ac $TMPDIR is set via the
dbus runner which took precedence.
virtme-ng doesn't seem to share /tmp with the host system which results
in the exit status from the test in the VM not propagating back to the
test harness.
Fix that by making sure we always create the tempfile for the result in
the build directory.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3867>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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")
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>
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>