mirror of
https://github.com/brl/mutter.git
synced 2025-02-04 15:44:10 +00:00
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
@ -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
|
else
|
||||||
{
|
{
|
||||||
|
@ -66,6 +66,7 @@ typedef struct _MetaKmsPlaneAssignment
|
|||||||
MetaKmsPlaneRotation rotation;
|
MetaKmsPlaneRotation rotation;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
gboolean has_update;
|
||||||
gboolean is_valid;
|
gboolean is_valid;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
@ -607,6 +607,7 @@ meta_kms_plane_assignment_set_cursor_hotspot (MetaKmsPlaneAssignment *plane_assi
|
|||||||
int x,
|
int x,
|
||||||
int y)
|
int y)
|
||||||
{
|
{
|
||||||
|
plane_assignment->cursor_hotspot.has_update = TRUE;
|
||||||
plane_assignment->cursor_hotspot.is_valid = TRUE;
|
plane_assignment->cursor_hotspot.is_valid = TRUE;
|
||||||
plane_assignment->cursor_hotspot.x = x;
|
plane_assignment->cursor_hotspot.x = x;
|
||||||
plane_assignment->cursor_hotspot.y = y;
|
plane_assignment->cursor_hotspot.y = y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user