[gnome-remote-desktop] session: Implement NotifyPointerAxis()



commit 90b0172aad78d7eafa16d0088bf199044cf37794
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Sun Dec 13 16:10:44 2020 +0100

    session: Implement NotifyPointerAxis()
    
    Now that the remote desktop API in gnome-remote-desktop has been
    synchronized with API in mutter, implement the NotifyPointerAxis
    function.
    This function allows a remote desktop client to scroll without using
    discrete steps, which is necessary for RDP clients, where the user
    uses a high resolution mouse wheel.

 src/grd-session.c | 13 +++++++++++++
 src/grd-session.h | 13 +++++++++++++
 2 files changed, 26 insertions(+)
---
diff --git a/src/grd-session.c b/src/grd-session.c
index 90b4203..bbaee00 100644
--- a/src/grd-session.c
+++ b/src/grd-session.c
@@ -135,6 +135,19 @@ grd_session_notify_pointer_button (GrdSession *session,
                                                               NULL);
 }
 
+void
+grd_session_notify_pointer_axis (GrdSession          *session,
+                                 double               dx,
+                                 double               dy,
+                                 GrdPointerAxisFlags  flags)
+{
+  GrdSessionPrivate *priv = grd_session_get_instance_private (session);
+  GrdDBusRemoteDesktopSession *session_proxy = priv->remote_desktop_session;
+
+  grd_dbus_remote_desktop_session_call_notify_pointer_axis (
+    session_proxy, dx, dy, flags, NULL, NULL, NULL);
+}
+
 void
 grd_session_notify_pointer_axis_discrete (GrdSession    *session,
                                           GrdPointerAxis axis,
diff --git a/src/grd-session.h b/src/grd-session.h
index e965daa..2dc6f48 100644
--- a/src/grd-session.h
+++ b/src/grd-session.h
@@ -43,6 +43,14 @@ typedef enum _GrdButtonState
   GRD_BUTTON_STATE_PRESSED
 } GrdButtonState;
 
+typedef enum _GrdPointerAxisFlags
+{
+  GRD_POINTER_AXIS_FLAGS_FINISH = 1 << 0,
+  GRD_POINTER_AXIS_FLAGS_SOURCE_WHEEL = 1 << 1,
+  GRD_POINTER_AXIS_FLAGS_SOURCE_FINGER = 1 << 2,
+  GRD_POINTER_AXIS_FLAGS_SOURCE_CONTINUOUS = 1 << 3,
+} GrdPointerAxisFlags;
+
 typedef enum _GrdPointerAxis
 {
   GRD_POINTER_AXIS_VERTICAL,
@@ -68,6 +76,11 @@ void grd_session_notify_pointer_button (GrdSession     *session,
                                         int32_t         button,
                                         GrdButtonState  state);
 
+void grd_session_notify_pointer_axis (GrdSession          *session,
+                                      double               dx,
+                                      double               dy,
+                                      GrdPointerAxisFlags  flags);
+
 void grd_session_notify_pointer_axis_discrete (GrdSession     *session,
                                                GrdPointerAxis  axis,
                                                int             steps);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]