MetaWaylandTabletTool is not a GObject thus we cannot use weak pointers
on them. The good news is that MetaWaylandTabletTool structs are perennial
and we do not need to do that.
Remove this unnecessary weak pointer handling, which can only cause
runtime warnings or crashes.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4367>
Changing to a cursor shape would set the cursor surface to NULL, so
trying to disable the cursor by setting the cursor surface to NULL was
detected as no-change. This commit fixes the check by taking into
account if the cursor shape is currently set.
Also adds a ref-test for it.
Fixes: 005b969227 ("wayland: Implement the cursor_shape_v1 protocol")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3997
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4358>
Make the prepare function a vfunc of MetaCursorSprite, moving the root
cursor prepare function into MetaCursorSpriteXcursor. This should solve
two issues:
- The root cursor prepare function was changed in f77d8e2a12a07ef6abe9
to solve an issue with fractional scales. The tool cursor prepare
function was missing this fix.
- The cursors created via the shape protocol had no prepare function at
all, so were not getting scaled.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3975
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4345>
In `should_constraint_be_enabled()` calling
`meta_wayland_surface_get_window()` could return a null window when the
toplevel is reset after locking pointer.
The null check was only done inside `HAVE_XWAYLAND` ifdef, and so if
mutter is built without xwayland it could lead to a crash.
Fixes: 6e818c8c38 ("build: Allow disabling xwayland")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4351>
No actual changes. We will use this version to hint GTK about
the availability of non broken wl_surface.offset support for
pointer cursors.
GTK can use this version to avoid cursor breakage when running
on older Mutter versions.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4327>
Any feedbacks for the same stage view but older frames than the one
being presented are discarded.
Since we now use per-frame lists of feedbacks, there can no longer be
any stale feedbacks where we previously discarded them, so remove that
dead code.
v2:
* Use ClutterFrameInfo::frame_count.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4306>
The thing before pretended to be a map but wasn't, so it required
iterating over it and checking the fields to find the requested one. The
code didn't do that and index into it anyway and because the shapes
start at a value of 1, everything was off.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4307>
The protocol changes for version 2 made it upstream but are not in a
release, yet. As soon as we have a release, we should replace this copy
with the wayland-protocols variant.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4307>
When a client binds to the a device, if obtaining a non-privileged fd
fails, instead of returning an error, put the client in a pending
queue.
Delaying the drm_fd is allowed by the protocol definition:
The compositor will send this event when the wp_drm_lease_device_v1
global is bound, although there are no guarantees as to how long
this takes [...]
A future commit will send the drm_fd events to the clients in the list
once Mutter can obtain a valid fd.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3921>
This might be possible if extended target volume is supported but
currently it isn't.
This is a requirement from the wayland color management:
"'reference_lum' may be higher than 'max_lum'. In that case reaching
the reference white output level in image content requires the
'extended_target_volume' feature support."
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4304>
Ensure the window is placed in coordinates, before maximizing, tiling or
minimizing it. This should make the window maximized/tiled on the right
(or correctmost) monitor given the stored coordinates.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4311>
When closing some wayland apps using text-input-v3, text_input_destructor
could remove resource in focus_resource_list without resetting focus.
This could be an issue if, the focus is on a wayland app not using text-
input-v3 after closing those. Text committing would fail, and the
candidate window would always show on previous entry.
This commit adds check in text_input_destructor, resetting focus if
necessary.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4776
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4164>
Version 1 of the presentation protocol requires that 0 be sent for the
refresh rate for variable refresh rate. Fix this by checking the mode
during the presentation event.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4227>
Ignore the gravity argument in the move_resize_internal() vmethod,
and use the window getter to get it. It should be functionally
equivalent, and will eventually replace the argument entirely.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
New protocol that allows a client to require that a previously flagged
content update must be presented before a content update can be applied.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>
Allow a transaction to have a timing constraint.
Any transaction with a timing constraint will be deferred at its initial
commit, without testing the target time. The timing constraints are cleared
later in an on_before handler immediately before repaint.
The new frame clock api to schedule later ticks is use to ensure we get an
appropraitely timed tick to clear the constraint.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>