Commit graph

7 commits

Author SHA1 Message Date
Vlad Zahorodnii
f286c311d5 Revert "cursorsource: fix scaling with Xwayland"
This reverts commit 81571203f1.
2023-04-11 10:01:05 +00:00
Xaver Hugl
4cd25cf571 cursor: make position, hotspot and size floating point
This allows all pixel positions to be used on high dpi screens,
and corrects damage tracking with Xwayland cursors

CCBUG: 466094
2023-02-20 21:01:39 +00:00
Xaver Hugl
81571203f1 cursorsource: fix scaling with Xwayland
Before this commit, the device pixel ratio of the cursor was set to ignore
the Xwayland scale override, while the size of the cursor surface was scaled.
This change removes the scaling of the cursor surface size, to make the cursor
be no longer cut off in rendering.

BUG: 466094
2023-02-20 19:50:30 +01:00
Vlad Zahorodnii
bcdb2ff57c Add CursorSource size getter
CursorSource::size() provides a way to get the size of the attached
cursor source without actually looking into its contents.
2022-12-21 18:30:27 +00:00
Vlad Zahorodnii
5553d0e0f4 Introduce SurfaceCursorSource
The contents of the cursor can be either a normal image or a wl_surface.
At the moment, we get an image from the wl_surface. But it's going to be
changed so we use SurfaceItem to render wl_surface cursors.

SurfaceCursorSource provides the way to get the wl_surface handle from
the cursor. In order to provide backwards compatibility, it also provides
a QImage.
2022-12-20 15:17:59 +02:00
Vlad Zahorodnii
b4569f5985 Add ShapeCursorSource
ShapeCursorSource provides the contents of the given cursor shape in the
Xcursor theme.

If the given cursor shape is animated, ShapeCursorSource will keep
updating its content based on the value of current sprite's delay value.
2022-11-23 20:10:59 +00:00
Vlad Zahorodnii
e552be6cb1 Add CursorSource
CursorSource acts as a black box providing the contents of the cursor.
That's it, the image and the hotspot.
2022-11-23 20:10:59 +00:00