This commit allows to make a role as not represented by an object,
which fixes calling role commit handlers for roles like cursor
surfaces.
Fixes: 099b9de752
If the set_cursor request is used with the same surface, don't call
cursor_output_cursor_reset_image(). That function sends
wl_surface.leave and can cause an infinite feedback loop with some
clients (submitting a LoDPI cursor when the surface leaves an HiDPI
output).
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3669
Currently, an icon surface's role_data is set manually to a struct
wlr_drag_icon, which is hacky, incorrect (as role_data is supposed
to be the surface's role object, and drag icons don't have them), and
will be disallowed by future changes.
Based on five calls:
wlr_render_timer_create - creates a timer which can be reused across
frames on the same renderer
wlr_renderer_begin_buffer_pass - now takes a timer so that backends can
record when the rendering starts and finishes
wlr_render_timer_get_time - should be called as late as possible so that
queries can make their way back from the GPU
wlr_render_timer_destroy - self-explanatory
The timer is exposed as an opaque `struct wlr_render_timer` so that
backends can store whatever they want in there.
read advances the file description offset, and requires the client to
ensure that it is reset appropriately before the next gamma ramp
submission. As there is no event to indicate that wlroots finished
processing the new gamma ramp, this can result in a race between the
client seeking in the file and wlroots reading its content.
Use pread with a fixed offset instead.
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3655
According to the protocol text, the popup will be immediately dismissed
when the grab is rejected. Because the grab can't be executed with a
destroyed seat, the popup is dismissed when one is provided.
Many issues here:
- wlr_output_cursor_set_buffer() takes a buffer already scaled for
the output, not a buffer with scale=1.
- wlr_output_cursor.{width,height,hotspot_x,hotspot_y} are in output
buffer coordinates.
- render_cursor_buffer() had hardcoded no-ops for scale and
transform, instead of using the cursor surface's.
Fixes: b64e7e88bf ("output: add output_cursor_set_texture()")
A client might update the cursor with the same wl_surface as
before, but with a different hotspot. Don't ignore such updates.
Fixes: 9c9e3f6263 ("cursor: ignore wlr_cursor_set_surface() with same surface")