remote-desktop: Add relative pointer motion event support

Relative pointer motions are assumed to be pre-accelerated.
This commit is contained in:
Jonas Ådahl 2018-01-29 14:40:57 +08:00
parent c459ad7932
commit d27e6921d6
2 changed files with 37 additions and 0 deletions

View File

@ -486,6 +486,32 @@ handle_notify_pointer_axis_discrete (MetaDBusRemoteDesktopSession *skeleton,
return TRUE; return TRUE;
} }
static gboolean
handle_notify_pointer_motion_relative (MetaDBusRemoteDesktopSession *skeleton,
GDBusMethodInvocation *invocation,
double dx,
double dy)
{
MetaRemoteDesktopSession *session = META_REMOTE_DESKTOP_SESSION (skeleton);
if (!check_permission (session, invocation))
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_ACCESS_DENIED,
"Permission denied");
return TRUE;
}
clutter_virtual_input_device_notify_relative_motion (session->virtual_pointer,
CLUTTER_CURRENT_TIME,
dx, dy);
meta_dbus_remote_desktop_session_complete_notify_pointer_motion_relative (skeleton,
invocation);
return TRUE;
}
static gboolean static gboolean
handle_notify_pointer_motion_absolute (MetaDBusRemoteDesktopSession *skeleton, handle_notify_pointer_motion_absolute (MetaDBusRemoteDesktopSession *skeleton,
GDBusMethodInvocation *invocation, GDBusMethodInvocation *invocation,
@ -523,6 +549,7 @@ meta_remote_desktop_session_init_iface (MetaDBusRemoteDesktopSessionIface *iface
iface->handle_notify_pointer_button = handle_notify_pointer_button; iface->handle_notify_pointer_button = handle_notify_pointer_button;
iface->handle_notify_pointer_axis = handle_notify_pointer_axis; iface->handle_notify_pointer_axis = handle_notify_pointer_axis;
iface->handle_notify_pointer_axis_discrete = handle_notify_pointer_axis_discrete; iface->handle_notify_pointer_axis_discrete = handle_notify_pointer_axis_discrete;
iface->handle_notify_pointer_motion_relative = handle_notify_pointer_motion_relative;
iface->handle_notify_pointer_motion_absolute = handle_notify_pointer_motion_absolute; iface->handle_notify_pointer_motion_absolute = handle_notify_pointer_motion_absolute;
} }

View File

@ -110,6 +110,16 @@
<arg name="steps" type="i" direction="in" /> <arg name="steps" type="i" direction="in" />
</method> </method>
<!--
NotifyPointerMotionRelative:
A absolute pointer motion event notification
-->
<method name="NotifyPointerMotionRelative">
<arg name="dx" type="d" direction="in" />
<arg name="dy" type="d" direction="in" />
</method>
<!-- <!--
NotifyPointerMotionAbsolute: NotifyPointerMotionAbsolute: