ui/dbus: set mouse is-absolute during console creation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
e74fec9aa4
commit
eb9062d4cf
@ -411,15 +411,21 @@ dbus_mouse_release(DBusDisplayConsole *ddc,
|
||||
return DBUS_METHOD_INVOCATION_HANDLED;
|
||||
}
|
||||
|
||||
static void
|
||||
dbus_mouse_update_is_absolute(DBusDisplayConsole *ddc)
|
||||
{
|
||||
g_object_set(ddc->iface_mouse,
|
||||
"is-absolute", qemu_input_is_absolute(),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dbus_mouse_mode_change(Notifier *notify, void *data)
|
||||
{
|
||||
DBusDisplayConsole *ddc =
|
||||
container_of(notify, DBusDisplayConsole, mouse_mode_notifier);
|
||||
|
||||
g_object_set(ddc->iface_mouse,
|
||||
"is-absolute", qemu_input_is_absolute(),
|
||||
NULL);
|
||||
dbus_mouse_update_is_absolute(ddc);
|
||||
}
|
||||
|
||||
int dbus_display_console_get_index(DBusDisplayConsole *ddc)
|
||||
@ -492,6 +498,7 @@ dbus_display_console_new(DBusDisplay *display, QemuConsole *con)
|
||||
register_displaychangelistener(&ddc->dcl);
|
||||
ddc->mouse_mode_notifier.notify = dbus_mouse_mode_change;
|
||||
qemu_add_mouse_mode_change_notifier(&ddc->mouse_mode_notifier);
|
||||
dbus_mouse_update_is_absolute(ddc);
|
||||
|
||||
return ddc;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user