2365 Commits

Author SHA1 Message Date
Jonas Ådahl
3d45345789 tests/cursor-tests: Also test a couple of fractional scales
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
2024-12-11 16:22:57 +00:00
Robert Mader
e674c7e454 cursor-sprite: Add API for viewports
[jadahl] Rework hotspot calculations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
2024-12-11 16:22:57 +00:00
Jonas Ådahl
f4201bc3d3 service-channel: Add global shotcuts portal backend client type
The global shortcuts portal backend component lives in
gnome-control-center, and is responsible for preseting the GUI for
managing client provided global shortcuts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4173>
2024-12-10 17:02:24 +00:00
Jonas Ådahl
0f195078cb wayland/x11-interop: Make allow list more declarative
Declare allowed service client types in a list, and loop through them,
instead of doing it manually.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4173>
2024-12-10 17:02:24 +00:00
Michel Dänzer
4284371a26 wayland/outputs: Use g_hash_table_steal_extended in _update_outputs
g_hash_table_steal leaked the MetaMonitorSpec key in the old
compositor->outputs hash table:

==1059254== 62 (32 direct, 30 indirect) bytes in 1 blocks are definitely lost in loss record 8,232 of 13,059
==1059254==    at 0x48489F3: calloc (vg_replace_malloc.c:1340)
==1059254==    by 0x4C65C19: g_malloc0 (gmem.c:133)
==1059254==    by 0x4956FE8: meta_monitor_spec_clone (meta-monitor.c:108)
==1059254==    by 0x4A7B9E8: meta_wayland_compositor_update_outputs (meta-wayland-outputs.c:555)
==1059254==    by 0x4A7C09E: meta_wayland_outputs_init (meta-wayland-outputs.c:796)
==1059254==    by 0x4A63B60: meta_wayland_compositor_new (meta-wayland.c:874)
==1059254==    by 0x49B58D0: meta_context_start (meta-context.c:523)
==1059254==    by 0x10A8D7: main (mutter.c:148)
==1059254==
==1059254== 62 (32 direct, 30 indirect) bytes in 1 blocks are definitely lost in loss record 8,233 of 13,059
==1059254==    at 0x48489F3: calloc (vg_replace_malloc.c:1340)
==1059254==    by 0x4C65C19: g_malloc0 (gmem.c:133)
==1059254==    by 0x4956FE8: meta_monitor_spec_clone (meta-monitor.c:108)
==1059254==    by 0x4A7B9E8: meta_wayland_compositor_update_outputs (meta-wayland-outputs.c:555)
==1059254==    by 0x4A7BA8C: on_monitors_changed (meta-wayland-outputs.c:572)
==1059254==    by 0x4F5E9BF: g_closure_invoke (gclosure.c:833)
==1059254==    by 0x4F72D82: signal_emit_unlocked_R.isra.0 (gsignal.c:3887)
==1059254==    by 0x4F747A8: signal_emit_valist_unlocked (gsignal.c:3519)
==1059254==    by 0x4F7A665: g_signal_emit_valist (gsignal.c:3262)
==1059254==    by 0x4F7A722: g_signal_emit (gsignal.c:3582)
==1059254==    by 0x49691BD: meta_monitor_manager_notify_monitors_changed (meta-monitor-manager.c:1241)
==1059254==    by 0x496EA8D: meta_monitor_manager_rebuild (meta-monitor-manager.c:3968)

v2:
* Use g_autoptr. (Sebastian Wick, Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4149>
2024-12-06 16:49:34 +00:00
Jonas Ådahl
fbe00573d7 xwayland/dnd: Handle stage to protocol transformations
We'd send stage coordinates via the Xdnd X11 protocol, but X11 clients
expect X11 protocol coordinates. Make sure to transform these
accordingly. The same applies to the size of our DND cover window, which
needs to be move/resize:ed in protocol coordinates.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3815
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4169>
2024-12-06 11:53:50 +00:00
Jonas Ådahl
796ee28b1c xwayland: Move protocol <-> stage calculations to Xwayland manager
Will make it more convenient to use without a MetaWindow at hand.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4169>
2024-12-06 11:53:50 +00:00
Sebastian Wick
918dd0c293 wayland/buffer: Do not guard explicit sync releases by buffer->resource
The buffer resource doesn't need to exist for a timeline to exist so we
still have to send the timeline release. Only guard the
wl_buffer_send_relase call.

Fixes: e8b890ab53 ("wayland: Implement linux-drm-syncobj-v1")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4157>
2024-12-06 08:56:23 +00:00
Carlos Garnacho
18c8efcd42 wayland: Lock touch sequence info on first entered surface
Even though the touch moved to being set up in CLUTTER_ENTER, it
is still meant to lock onto the pressed surface, we however will
receive crossing events if the touch moves between actors/surfaces,
triggering warnings when the touch info registration is attempted
on the already existing touch sequence.

The reasons to handle this in CLUTTER_ENTER still apply, so ensure
the touch info for the sequence does not previously exist to avoid
the warning.

Fixes: 2e82a2049f ("wayland: Register touchpoint info on CLUTTER_ENTER")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4166>
2024-12-05 22:35:26 +00:00
Carlos Garnacho
f637b8b12c wayland: Drop invalidate focus flags
This is not necessary anymore, so far can be dropped.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4166>
2024-12-05 22:35:26 +00:00
Carlos Garnacho
5cb8773409 wayland: Emit wl_touch.cancel in seat focus handling
We try to emit wl_touch.cancel in the situations where grabbing input
would take input away from the wl_touch interface. This however does
not play fine with grabs induced by wayland interfaces (e.g. xdg popups).

A more natural place to handle this is the MetaWaylandSeats' default
input handler, specifically the focus() vmethod. Here, we may know if the
focus surface matches the current surface as picked by MetaWaylandTouch,
and if it does not, either a grab or another input handler stole input
away from the default event handler.

A case where this will notably not happen anymore is in the transition
to a xdg_popup grab, since the grabbing client will still be handling
input, and touch input will not be unfocused away despite the transition
to a grab.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3752
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4166>
2024-12-05 22:35:26 +00:00
Carlos Garnacho
c9fa30c55b wayland: Handle reentrancy invalidating touch foci
The hashtable containing per-sequence touch info may change while
invalidating the focus, so grab a copy first of the existing sequences.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4166>
2024-12-05 22:35:26 +00:00
Carlos Garnacho
f28f31fc32 wayland: Fix updating pointer cursor on Drag and Drop
The logic to allow src/wayland to update the pointer cursor changed
to bypassing grabs in commit e69e4fa6, since it is nowadays the
responsibility of the DnD source to update the pointer cursor in reaction
to the negotiated action.

This is not entirely correct, and was done at the expense of regressions.
Change the logic so we explicitly check for a DnD grab existing, or use
the active focus instead (i.e. grab-aware). This fixes the regression, and
keep DnD cursor icons working.

This is a partial revert of commit e69e4fa6dbbd62677de61bcd2f5f3bec515e79ce.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3460
Fixes: e69e4fa6db ("Revert "wayland: Check focus surface to set a pointer cursor"")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4166>
2024-12-05 22:35:26 +00:00
Joan Torres
7f8df9d9a1 clutter/color-state-params: Add new_from_primitives
When creating a new color state from the primitives Colorimetry, EOTF
and Luminance; it is needed to previously check their tags to properly get
their values and avoid UB.

This check is duplicated and is a bit unreadable.

Using this new function helps keeping readability.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
2024-12-05 22:24:05 +00:00
Joan Torres
7e847b555b clutter/color-state: Abstract color state and add Params subclass
Most of the implementation at color state was specific to a color state
generated from parameters so move it to a new class Params.

In the next commits a new color state ICC class will be added.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
2024-12-05 22:24:05 +00:00
Nick Diego Yamane
19e319b3b4 wayland/xdg-toplevel-drag: Expose the protocol
Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4107>
2024-11-29 20:51:52 -04:00
Nick Diego Yamane
0111f0de14 wayland/xdg-toplevel-drag: Plumb xdg-toplevel-drag to core/compositor
- Event stream adaptations. When there is a toplevel-drag in place, do:
  - Send wl_data_source.dnd_finished and end the session successfully
  - Send wl_data_source.cancelled and end the MetaWindowDrag when ESC key
    is pressed.
- Modify MetaWaylandDataDevice such that, when a toplevel-drag is
  running, it does:
  - Propagate motion events, so that they can be processed further by
    MetaWindowDrag.
  - Ends the associated MetaWindowDrag upon release event.
- Hook up the window mapping process in MetaWindowWayand, such that:
  - the initial position of the window attached to the ongoing
    toplevel-drag instance can be calculated and set.
  - the appropriate gravity and flags can be set when calling MetaWindow's
    meta_window_move_resize_internal, which allows it for example to be
    moved freely (unconstrained) as per current dragging cursor.

Status:

- [x] Basic window drag triggering
- [x] Exclude the dragged window from event targets
- [x] Event forwarding (window drag vs wayland grabs)
- [x] Offset calc relative to toplevel geometry
- [x] Attach already mapped windows
- [x] Properly support not-yet-mapped windows
- [x] Disable visibility change animations
- [x] Dnd events stream adaptations

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4107>
2024-11-29 20:51:52 -04:00
Nick Diego Yamane
66cfbf03c9 wayland/xdg-toplevel-drag: Add the protocol implementation
- For already mapped windows, the window drag session is started
  straight away;
- For about-to-be-mapped window (ie: undocking window use case):
  - The "shown" signal for the dragged window triggers the actual
    MetaWindowDrag once it's mapped.
  - MetaWindowWayland now handles the case of toplevel-drag and position
    the window about to be mapped according to the toplevel-drag
    parameters.
- While attached to a toplevel-drag, the window state is updated to:
  - Actor's "reactive" state is set to false, which in practice excludes
    it from the possible drag target list;
  - WindowActor's "tied to drag" state is set to true, which results in
    initial placement constraints to be skipped, so newly created
    (detached) windows can be freely dragged around.
- Toplevel drag session ends upon:
  - dnd drop and cancellation.
  - xdg_toplevel_drag_v1 object destruction (client-side).
  - data source destruction.

Status:

- [x] Basic window drag triggering
- [x] Exclude the dragged window from event targets
- [x] Event forwarding (window drag vs wayland grabs)
- [x] Offset calc relative to toplevel geometry
- [x] Attach already mapped windows
- [x] Properly support not-yet-mapped windows
- [ ] Disable visibility change animations
- [ ] Dnd events stream adaptations

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4107>
2024-11-29 20:51:52 -04:00
Nick Diego Yamane
848612b08f wayland/xdg-toplevel-drag: Add destroy signal to data source
It will be used by xdg-toplevel-drag protocol implementation.

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4107>
2024-11-29 20:31:24 -04:00
Nick Diego Yamane
3e0fd4b26b wayland/xdg-toplevel-drag: Expose meta_wayland_xdg_surface_get_window_geometry
Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4107>
2024-11-28 18:08:48 -04:00
Jonas Ådahl
85d2d49499 wayland/surface: Unconditionally set scanout destination rect
The cogl_scanout_get_dst_rect() fell back on the buffer dimensions as
the destination rectangle when nothing was explicitly set. This,
however, is not necessarily correct. For example, if a buffer is larger
the CRTC resolution, but the surface is scaled to exactly match the CRTC view,
the expected destination size should match the CRTC resolution, not the
buffer dimension, which would be the case if no explicit destination was
set.

In meta_wayland_try_aquire_scanout() we're in a good position to
determine the destination rect in the CRTC primary plane, since we have
all the prerequisits, i.e. that the surface effectively covers the whole
CRTC, the actor allocation box (the non-black border part), the scale
and transform of the view.

This tweaks the CoglScanout API a bit to make it explicit that the
dst_rect must be unconditionally provided, and removes the fallback to
the buffer dimension as the destination rectangle, which sometimes
resulted in a destination rectangle being larger than the primary plane
itself, resulting in clipping and incorrect scaling.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3773
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4147>
2024-11-27 20:18:31 +00:00
Jonas Ådahl
d1ec1d7c61 wayland/surface: Fix bounding box rect when calculating scanout
The "dst_rect" calculated is in "CRTC space", meaning the bounding box
used for calculating it should be the view layout dimension, scaled by
the view scale and transform by the view transform. Previously it was
only transformed, not scaled. While fixing this, rename the variables to
make it a bit more clear what coordinate space they are expected to be
in.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4147>
2024-11-27 20:18:31 +00:00
Jonas Ådahl
2149427f4a wayland/buffer: Also pass src/dst rect when trying to scanout EGLImage
Do the same as in the DMA buffer case, and just pass it forward.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4147>
2024-11-27 20:18:31 +00:00
Alessandro Astone
7f89e5b881 wayland: Invalidate focus from all touch inputs too
This allows drag-and-drop within the same surface with touch input.

Test case: drag-and-drop a file into a directory in Nautilus.
Prior to this change that would only work if the finger first leaves
then re-enters the surface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4091>
2024-11-22 18:45:25 +00:00
Takao Fujiwara
fb86d5d5b0 wayland/text-input: Reset surrounding text values by focus change
For zwp_text_input_v3_set_surrounding_text(), the protocol specifies:

"If the client is unaware of the text around the cursor, it should
not issue this request, to signify lack of support to the compositor."

Mutter currently doesn't clear its stored surrounding text when the
input focus changes, re-using the existing text for the newly focused
client. This already seems problematic, but since clients aren't
supposed to set surrounding text to NULL or an empty string if they
don't have one (and instead should simply avoid calling
`set_surrounding_text()`), this is clearly a bug in Mutter.

Fix it by unsetting the stored surrounding text when removing input
focus from a client.

Fixes: 33088d59db ("wayland/text-input: Pass char based offset to ClutterInputFocus")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3604>
2024-11-20 22:54:54 +00:00
Michel Dänzer
206ec7b46b wayland/cursor-surface: Schedule update for frame events
Without this, frame events may never be sent for the cursor surface if
nothing else happens to schedule an update.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3735

v2:
* Use meta_wayland_surface_get_main_monitor. (Sebastian Wick)
v3:
* Move some local variable initializers to the declarations in
  meta_wayland_cursor_schedule_update. (Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4113>
2024-11-20 19:27:26 +00:00
Jonas Dreßler
423f17a982 wayland/text-input: Add some input validation to set_surrounding()
The cursor and anchor position of the surrounding text *must* be within
(or right before/after) the string that is submitted as surrounding text.
Everything else is a client error that we shouldn't accept and log as such.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3650>
2024-11-19 17:57:17 +01:00
Jonas Dreßler
2c42a28420 wayland/text-input: Don't crash on wrong parameters to delete_surrounding()
meta_wayland_text_input_focus_delete_surrounding() is accessible from JS and
used by gnome-shell via ClutterInputMethod.delete_surrounding(). Mutter
should never crash on invalid function calls from JS, so g_return_if_fail()
instead of asserting in case the parameters are wrong here.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3650>
2024-11-17 20:48:31 +01:00
Olivier Fourdan
9927eaa963 wayland: Emit the configure signal
Emit the configure signal from the xdg_toplevel's apply_state function.

A plugin gets a chance to tweak the initial configuration before it gets
applied.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
c597feaa67 wayland/window-configuration: Add MetaWindowConfig support
This allows to bridge MetaWaylandWindowConfiguration and
MetaWindowConfig.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
4c20584b11 window: Use the MetaWindowConfig
This is a fairly large refactoring to replace the window rect and
fullscreen flag with the new MetaWindowConfig object.

No functional change intended at this point.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Jonas Ådahl
95e395c212 wayland: Add support for system bell protocol
This integrates with the system bell the same way as the equivalent
request in gtk-shell does.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3675>
2024-11-07 12:22:57 +00:00
Bilal Elmoussaoui
a5be92e03d Use _once variant of g_[timeout_idle]
Nice helpers that were added in GLib 2.72, so safe to make use of as we
depend on 2.81.1 already.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4115>
2024-11-04 21:18:37 +00:00
Bilal Elmoussaoui
8e5433d82a window: Replace barely used macros with func equivalents
To avoid mostly going through struct fields in macros as we might soon
move those first to a WindowConfiguration & maybe even make the window
struct private with time.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4111>
2024-10-30 16:25:37 +01:00
Olivier Fourdan
4c65cdec64 xwayland/surface: Connect "highest-scale-monitor-changed" signal
Similar to what MetaWaylandShellSurface does, connect the signal
"highest-scale-monitor-changed" to the handler
meta_wayland_surface_notify_highest_scale_monitor() so that
Xwaylandsurface can be notified of the fractional scale changes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3326
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3639>
2024-10-29 08:52:21 +00:00
Joan Torres
8f709f26e7 wayland/color-management: Fix setting luminances
It was missing setting luminance type to explicit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4108>
2024-10-25 17:30:23 +02:00
Sebastian Keller
cb34fafd57 wayland/pointer-constraints: Warp pointer after destroying resource
e994fbf02 moved warping the pointer to before the destruction of the
resource to prevent dereferencing the constraint after destruction.
This however meant that the constraint was still active when the motion
event caused by the warp is handled, which would constrain the pointer
back again to its original position.

This moves the warping of the pointer back to after the destruction of
the resource and instead just retrieves the seat earlier while the
constraint is still valid.

Fixes: e994fbf02 ("wayland/pointer-constraints: Warp pointer before destroying resource")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3696
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4098>
2024-10-19 20:49:16 +02:00
Bilal Elmoussaoui
3eb5381c46 wayland/inhibit-dialog: Drop duplicated hide call
the destroy and the response handler, already hide the dialog
themselves. The calls here were unnecessary.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3048
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4034>
2024-10-09 10:24:12 +00:00
Joan Torres
0ed0367d74 wayland/color-management: Add support for bt.709 TF
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:41:25 +02:00
Joan Torres
f671fea7b9 wayland/color-management: Add support for NTSC primaries
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:41:24 +02:00
Joan Torres
1d4061f21e wayland/color-management: When sending colorspace info send primaries too
clutter_primaries_to_wayland made sense when there only existed
ClutterColorspace. Now that ClutterPrimaries also exist, it makes more
sense to change that func to clutter_colorspace_to_wayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:40:51 +02:00
Joan Torres
fcbd2e3840 clutter/color-state: Add support for gamma TF
This TF can't be defined as a TransferFunction enum because it needs a
gamma_exp value too.

Add to EOTFType enum a new type: EOTF_TYPE_GAMMA.

With this new type, now EOTFs are unions that can have either
a TransferFunction enum or a gamma_exp.

Set gamma_exp as uniform.

Add the support of it in the color management protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
3b53f7cb6c clutter/color-state: Drop using default colorspace and default tf
Use the defaults explicitliy, which is SRGB for both.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
eff17bf1b5 clutter/color-state: Encapsulate primaries, tf and luminance
These properties now are tagged unions:
- ClutterColorimetry:
    Can be from colorspace or primaries;
- ClutterEOTF:
    Can be from known tf or custom gamma exp (next commit);
- ClutterLuminance:
    Can be defined explicitly or derived;

Make the color management protocol use them too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Jonas Ådahl
bce2790f7f Revert "window/wayland: Use scale for configured rect in configuration"
This caused https://gitlab.gnome.org/GNOME/mutter/-/issues/2616.

This reverts commit 2a62e690a21f98c22549d8a8c8a9b39916e1bc44.


(cherry picked from commit 2ea002c0df875b9bba18a8580b23e8f4ddfb042f)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4041>
2024-09-23 22:53:01 +00:00
José Expósito
9c536939a1 wayland/drm-lease: Fix reference count cycle
MetaWaylandDrmLeaseDevice and MetaWaylandDrmLeaseConnector hold a
reference to each other.

In both cases, the reference count was increased. Do not increase the
reference count when lease_connector->lease_device is stored to break
the reference count cycle.

Fixes: fb08a597e1d3 ("wayland/drm-lease: Advertize initial connectors")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
Joan Torres
cd65670f7a wayland/color-management: Support arbitrary primaries
The colorspace could be defined only with known colorspace names.
Now it can be defined with arbitrary primaries too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
95c9ba514d clutter/color-state: Add ClutterPrimaries
These primaries allow defining different colorspaces apart from the
known ones.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
c05e3e74ac wayland/single-pixel-buffer: Use higher precision pixel formats
The single pixel buffer allows setting colors with 32 bpc.

Attempt to use pixel formats that allow higher precision than BGRA_8888.

First attempt to use half float format, fallback to ABGR_2101010 and
finally fallback to BGRA_8888.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3913>
2024-09-23 20:21:38 +00:00
Jonas Ådahl
3bc3740a9e wayland/tablet-tool: Fix grabbing tablet devices
The NULL check was inverted, meaning we'd grab with no leader device.
That meant updates coming from the what-should-have-been leader device
getting lost because incorrectly being classified as non-leader of
the grab.

Fix this by only allowing to grab if we have a device, and always mark
the current tool device as the grab leader.

Fixes: e4004a7c4f ("wayland: Use the tool's current_tablet device instead of caching it")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4033>
2024-09-19 07:26:54 +00:00