backends/native: Add PLANE_PROP_HOTSPOT_[X,Y]

Add META_KMS_PLANE_PROP_HOTSPOT_[X,Y] properties
to the MetaKmsPlaneProp enumeration, and
properly initialise them.

Also, add a convenience method in meta-kms-plane
(i.e., `meta_kms_plane_supports_cursor_hotspot`)
to check whether a plane supports hotspot
property setting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3337>
This commit is contained in:
Albert Esteve
2023-10-23 15:08:44 +02:00
parent 8252f71447
commit 4b9d1271a0
4 changed files with 44 additions and 8 deletions

View File

@ -405,14 +405,17 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl,
.height = round (cursor_rect.size.height),
};
plane_assignment = meta_kms_update_assign_plane (update,
crtc, cursor_plane,
buffer,
src_rect, dst_rect,
assign_plane_flags);
meta_kms_plane_assignment_set_cursor_hotspot (plane_assignment,
(int) roundf (hotspot->x),
(int) roundf (hotspot->y));
if (meta_kms_plane_supports_cursor_hotspot (cursor_plane))
{
plane_assignment = meta_kms_update_assign_plane (update,
crtc, cursor_plane,
buffer,
src_rect, dst_rect,
assign_plane_flags);
meta_kms_plane_assignment_set_cursor_hotspot (plane_assignment,
(int) roundf (hotspot->x),
(int) roundf (hotspot->y));
}
}
else
{