summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2018-01-29 14:28:07 +0800
committerJonas Ådahl <jadahl@gmail.com>2018-02-23 19:33:31 +0800
commit1ead513b66a6bb9ce62255e685aa8d0d9f8ff34c (patch)
tree3c0da838189e9ce3f7fd0d28ca39f125d6c019d5
parent9ed236bd677d4a54b001c7a0b30fe863c372c6d1 (diff)
downloadmutter-1ead513b66a6bb9ce62255e685aa8d0d9f8ff34c.tar.gz
remote-desktop: Support multiple axis steps at once
Just call the corresponding clutter API once for each step.
-rw-r--r--src/backends/meta-remote-desktop-session.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/backends/meta-remote-desktop-session.c b/src/backends/meta-remote-desktop-session.c
index 0fb8c2da0..3c39ef6e4 100644
--- a/src/backends/meta-remote-desktop-session.c
+++ b/src/backends/meta-remote-desktop-session.c
@@ -26,6 +26,7 @@
#include <linux/input.h>
#include <xkbcommon/xkbcommon.h>
+#include <stdlib.h>
#include "backends/meta-dbus-session-watcher.h"
#include "backends/meta-screen-cast-session.h"
@@ -367,6 +368,7 @@ handle_notify_pointer_axis_discrete (MetaDBusRemoteDesktopSession *skeleton,
{
MetaRemoteDesktopSession *session = META_REMOTE_DESKTOP_SESSION (skeleton);
ClutterScrollDirection direction;
+ int step_count;
if (!check_permission (session, invocation))
{
@@ -392,19 +394,18 @@ handle_notify_pointer_axis_discrete (MetaDBusRemoteDesktopSession *skeleton,
return TRUE;
}
- if (steps != -1 && steps != 1)
- g_warning ("Multiple steps at at once not yet implemented, treating as one.");
-
/*
* We don't have the actual scroll source, but only know they should be
* considered as discrete steps. The device that produces such scroll events
* is the scroll wheel, so pretend that is the scroll source.
*/
direction = discrete_steps_to_scroll_direction (axis, steps);
- clutter_virtual_input_device_notify_discrete_scroll (session->virtual_pointer,
- CLUTTER_CURRENT_TIME,
- direction,
- CLUTTER_SCROLL_SOURCE_WHEEL);
+
+ for (step_count = 0; step_count < abs (steps); step_count++)
+ clutter_virtual_input_device_notify_discrete_scroll (session->virtual_pointer,
+ CLUTTER_CURRENT_TIME,
+ direction,
+ CLUTTER_SCROLL_SOURCE_WHEEL);
meta_dbus_remote_desktop_session_complete_notify_pointer_axis_discrete (skeleton,
invocation);