dbus-console.c (0175121c6c54ee2cd568594d54001275712f309f) | dbus-console.c (0337e4123e62721bd0bcb4d5645fee2a31e8906d) |
---|---|
1/* 2 * QEMU DBus display console 3 * 4 * Copyright (c) 2021 Marc-André Lureau <marcandre.lureau@redhat.com> 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 372 unchanged lines hidden (view full) --- 381 382static gboolean 383dbus_mouse_rel_motion(DBusDisplayConsole *ddc, 384 GDBusMethodInvocation *invocation, 385 int dx, int dy) 386{ 387 trace_dbus_mouse_rel_motion(dx, dy); 388 | 1/* 2 * QEMU DBus display console 3 * 4 * Copyright (c) 2021 Marc-André Lureau <marcandre.lureau@redhat.com> 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 372 unchanged lines hidden (view full) --- 381 382static gboolean 383dbus_mouse_rel_motion(DBusDisplayConsole *ddc, 384 GDBusMethodInvocation *invocation, 385 int dx, int dy) 386{ 387 trace_dbus_mouse_rel_motion(dx, dy); 388 |
389 if (qemu_input_is_absolute()) { | 389 if (qemu_input_is_absolute(ddc->dcl.con)) { |
390 g_dbus_method_invocation_return_error( 391 invocation, DBUS_DISPLAY_ERROR, 392 DBUS_DISPLAY_ERROR_INVALID, 393 "Mouse is not relative"); 394 return DBUS_METHOD_INVOCATION_HANDLED; 395 } 396 397 qemu_input_queue_rel(ddc->dcl.con, INPUT_AXIS_X, dx); --- 50 unchanged lines hidden (view full) --- 448dbus_mouse_set_pos(DBusDisplayConsole *ddc, 449 GDBusMethodInvocation *invocation, 450 guint x, guint y) 451{ 452 int width, height; 453 454 trace_dbus_mouse_set_pos(x, y); 455 | 390 g_dbus_method_invocation_return_error( 391 invocation, DBUS_DISPLAY_ERROR, 392 DBUS_DISPLAY_ERROR_INVALID, 393 "Mouse is not relative"); 394 return DBUS_METHOD_INVOCATION_HANDLED; 395 } 396 397 qemu_input_queue_rel(ddc->dcl.con, INPUT_AXIS_X, dx); --- 50 unchanged lines hidden (view full) --- 448dbus_mouse_set_pos(DBusDisplayConsole *ddc, 449 GDBusMethodInvocation *invocation, 450 guint x, guint y) 451{ 452 int width, height; 453 454 trace_dbus_mouse_set_pos(x, y); 455 |
456 if (!qemu_input_is_absolute()) { | 456 if (!qemu_input_is_absolute(ddc->dcl.con)) { |
457 g_dbus_method_invocation_return_error( 458 invocation, DBUS_DISPLAY_ERROR, 459 DBUS_DISPLAY_ERROR_INVALID, 460 "Mouse is not absolute"); 461 return DBUS_METHOD_INVOCATION_HANDLED; 462 } 463 464 width = qemu_console_get_width(ddc->dcl.con, 0); --- 44 unchanged lines hidden (view full) --- 509 510 return DBUS_METHOD_INVOCATION_HANDLED; 511} 512 513static void 514dbus_mouse_update_is_absolute(DBusDisplayConsole *ddc) 515{ 516 g_object_set(ddc->iface_mouse, | 457 g_dbus_method_invocation_return_error( 458 invocation, DBUS_DISPLAY_ERROR, 459 DBUS_DISPLAY_ERROR_INVALID, 460 "Mouse is not absolute"); 461 return DBUS_METHOD_INVOCATION_HANDLED; 462 } 463 464 width = qemu_console_get_width(ddc->dcl.con, 0); --- 44 unchanged lines hidden (view full) --- 509 510 return DBUS_METHOD_INVOCATION_HANDLED; 511} 512 513static void 514dbus_mouse_update_is_absolute(DBusDisplayConsole *ddc) 515{ 516 g_object_set(ddc->iface_mouse, |
517 "is-absolute", qemu_input_is_absolute(), | 517 "is-absolute", qemu_input_is_absolute(ddc->dcl.con), |
518 NULL); 519} 520 521static void 522dbus_mouse_mode_change(Notifier *notify, void *data) 523{ 524 DBusDisplayConsole *ddc = 525 container_of(notify, DBusDisplayConsole, mouse_mode_notifier); --- 99 unchanged lines hidden --- | 518 NULL); 519} 520 521static void 522dbus_mouse_mode_change(Notifier *notify, void *data) 523{ 524 DBusDisplayConsole *ddc = 525 container_of(notify, DBusDisplayConsole, mouse_mode_notifier); --- 99 unchanged lines hidden --- |