backends/native: Set hotspot property on updates
Add a `has_update` flag to the cursor hotspot struct to allow selective update of the hotsport property only when it will take an effect. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3337>
This commit is contained in:
parent
4b9d1271a0
commit
3885d2b3f6
3 changed files with 33 additions and 0 deletions
|
@ -612,6 +612,37 @@ process_plane_assignment (MetaKmsImplDevice *impl_device,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (plane_assignment->cursor_hotspot.has_update)
|
||||
{
|
||||
struct {
|
||||
MetaKmsPlaneProp prop;
|
||||
uint64_t value;
|
||||
} props[] = {
|
||||
{
|
||||
.prop = META_KMS_PLANE_PROP_HOTSPOT_X,
|
||||
.value = plane_assignment->cursor_hotspot.is_valid ?
|
||||
plane_assignment->cursor_hotspot.x :
|
||||
0,
|
||||
},
|
||||
{
|
||||
.prop = META_KMS_PLANE_PROP_HOTSPOT_Y,
|
||||
.value = plane_assignment->cursor_hotspot.is_valid ?
|
||||
plane_assignment->cursor_hotspot.y :
|
||||
0,
|
||||
},
|
||||
};
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (props); i++)
|
||||
{
|
||||
if (!add_plane_property (impl_device,
|
||||
plane, req,
|
||||
props[i].prop,
|
||||
props[i].value,
|
||||
error))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@ typedef struct _MetaKmsPlaneAssignment
|
|||
MetaKmsPlaneRotation rotation;
|
||||
|
||||
struct {
|
||||
gboolean has_update;
|
||||
gboolean is_valid;
|
||||
int x;
|
||||
int y;
|
||||
|
|
|
@ -607,6 +607,7 @@ meta_kms_plane_assignment_set_cursor_hotspot (MetaKmsPlaneAssignment *plane_assi
|
|||
int x,
|
||||
int y)
|
||||
{
|
||||
plane_assignment->cursor_hotspot.has_update = TRUE;
|
||||
plane_assignment->cursor_hotspot.is_valid = TRUE;
|
||||
plane_assignment->cursor_hotspot.x = x;
|
||||
plane_assignment->cursor_hotspot.y = y;
|
||||
|
|
Loading…
Reference in a new issue