mouse: Add method to show/hide the system pointer

Add a new set_ptr_visible() method to the mouse uclass to allow hiding
and showing the system mouse pointer. This is useful with sandbox when
rendering a custom mouse pointer, such as in expo mode.

The method is optional and returns -ENOSYS if not supported by the
driver.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-03 07:19:46 -06:00
parent 94bb322813
commit 07680c67f8
2 changed files with 34 additions and 0 deletions

View File

@@ -83,6 +83,16 @@ int mouse_get_pos(struct udevice *dev, struct vid_pos *pos)
return 0;
}
int mouse_set_ptr_visible(struct udevice *dev, bool visible)
{
struct mouse_ops *ops = mouse_get_ops(dev);
if (!ops->set_ptr_visible)
return -ENOSYS;
return ops->set_ptr_visible(dev, visible);
}
UCLASS_DRIVER(mouse) = {
.id = UCLASS_MOUSE,
.name = "mouse",