diff --git a/src/backends/meta-remote-desktop-session.c b/src/backends/meta-remote-desktop-session.c index 4429c3567..1f83ff709 100644 --- a/src/backends/meta-remote-desktop-session.c +++ b/src/backends/meta-remote-desktop-session.c @@ -678,11 +678,17 @@ handle_notify_pointer_motion_absolute (MetaDBusRemoteDesktopSession *skeleton, return TRUE; } - meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y); - - clutter_virtual_input_device_notify_absolute_motion (session->virtual_pointer, - CLUTTER_CURRENT_TIME, - abs_x, abs_y); + if (meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y)) + { + clutter_virtual_input_device_notify_absolute_motion (session->virtual_pointer, + CLUTTER_CURRENT_TIME, + abs_x, abs_y); + } + else + { + meta_topic (META_DEBUG_REMOTE_DESKTOP, + "Dropping early absolute pointer motion (%f, %f)", x, y); + } meta_dbus_remote_desktop_session_complete_notify_pointer_motion_absolute (skeleton, invocation); @@ -731,12 +737,18 @@ handle_notify_touch_down (MetaDBusRemoteDesktopSession *skeleton, return TRUE; } - meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y); - - clutter_virtual_input_device_notify_touch_down (session->virtual_touchscreen, - CLUTTER_CURRENT_TIME, - slot, - abs_x, abs_y); + if (meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y)) + { + clutter_virtual_input_device_notify_touch_down (session->virtual_touchscreen, + CLUTTER_CURRENT_TIME, + slot, + abs_x, abs_y); + } + else + { + meta_topic (META_DEBUG_REMOTE_DESKTOP, + "Dropping early touch down (%f, %f)", x, y); + } meta_dbus_remote_desktop_session_complete_notify_touch_down (skeleton, invocation); @@ -786,12 +798,18 @@ handle_notify_touch_motion (MetaDBusRemoteDesktopSession *skeleton, return TRUE; } - meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y); - - clutter_virtual_input_device_notify_touch_motion (session->virtual_touchscreen, - CLUTTER_CURRENT_TIME, - slot, - abs_x, abs_y); + if (meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y)) + { + clutter_virtual_input_device_notify_touch_motion (session->virtual_touchscreen, + CLUTTER_CURRENT_TIME, + slot, + abs_x, abs_y); + } + else + { + meta_topic (META_DEBUG_REMOTE_DESKTOP, + "Dropping early touch motion (%f, %f)", x, y); + } meta_dbus_remote_desktop_session_complete_notify_touch_motion (skeleton, invocation); diff --git a/src/backends/meta-screen-cast-area-stream.c b/src/backends/meta-screen-cast-area-stream.c index 9dd59fbfe..23d8c9828 100644 --- a/src/backends/meta-screen-cast-area-stream.c +++ b/src/backends/meta-screen-cast-area-stream.c @@ -148,7 +148,7 @@ meta_screen_cast_area_stream_set_parameters (MetaScreenCastStream *stream, area_stream->area.height)); } -static void +static gboolean meta_screen_cast_area_stream_transform_position (MetaScreenCastStream *stream, double stream_x, double stream_y, @@ -160,6 +160,8 @@ meta_screen_cast_area_stream_transform_position (MetaScreenCastStream *stream, *x = area_stream->area.x + (int) roundf (stream_x / area_stream->scale); *y = area_stream->area.y + (int) roundf (stream_y / area_stream->scale); + + return TRUE; } static void diff --git a/src/backends/meta-screen-cast-monitor-stream.c b/src/backends/meta-screen-cast-monitor-stream.c index d3ad20b3c..c7123a19b 100644 --- a/src/backends/meta-screen-cast-monitor-stream.c +++ b/src/backends/meta-screen-cast-monitor-stream.c @@ -184,7 +184,7 @@ meta_screen_cast_monitor_stream_set_parameters (MetaScreenCastStream *stream, logical_monitor_layout.height)); } -static void +static gboolean meta_screen_cast_monitor_stream_transform_position (MetaScreenCastStream *stream, double stream_x, double stream_y, @@ -200,6 +200,8 @@ meta_screen_cast_monitor_stream_transform_position (MetaScreenCastStream *stream *x = logical_monitor_layout.x + stream_x; *y = logical_monitor_layout.y + stream_y; + + return TRUE; } static void diff --git a/src/backends/meta-screen-cast-stream.c b/src/backends/meta-screen-cast-stream.c index fed1560fe..b8ab5abd5 100644 --- a/src/backends/meta-screen-cast-stream.c +++ b/src/backends/meta-screen-cast-stream.c @@ -177,18 +177,16 @@ meta_screen_cast_stream_get_src (MetaScreenCastStream *stream) return priv->src; } -void +gboolean meta_screen_cast_stream_transform_position (MetaScreenCastStream *stream, double stream_x, double stream_y, double *x, double *y) { - META_SCREEN_CAST_STREAM_GET_CLASS (stream)->transform_position (stream, - stream_x, - stream_y, - x, - y); + MetaScreenCastStreamClass *klass = META_SCREEN_CAST_STREAM_GET_CLASS (stream); + + return klass->transform_position (stream, stream_x, stream_y, x, y); } MetaScreenCastCursorMode diff --git a/src/backends/meta-screen-cast-stream.h b/src/backends/meta-screen-cast-stream.h index d121c15c1..3424def20 100644 --- a/src/backends/meta-screen-cast-stream.h +++ b/src/backends/meta-screen-cast-stream.h @@ -43,11 +43,11 @@ struct _MetaScreenCastStreamClass GError **error); void (* set_parameters) (MetaScreenCastStream *stream, GVariantBuilder *parameters_builder); - void (* transform_position) (MetaScreenCastStream *stream, - double stream_x, - double stream_y, - double *x, - double *y); + gboolean (* transform_position) (MetaScreenCastStream *stream, + double stream_x, + double stream_y, + double *x, + double *y); }; MetaScreenCastSession * meta_screen_cast_stream_get_session (MetaScreenCastStream *stream); @@ -61,11 +61,11 @@ char * meta_screen_cast_stream_get_object_path (MetaScreenCastStream *stream); MetaScreenCastStreamSrc * meta_screen_cast_stream_get_src (MetaScreenCastStream *stream); -void meta_screen_cast_stream_transform_position (MetaScreenCastStream *stream, - double stream_x, - double stream_y, - double *x, - double *y); +gboolean meta_screen_cast_stream_transform_position (MetaScreenCastStream *stream, + double stream_x, + double stream_y, + double *x, + double *y); MetaScreenCastCursorMode meta_screen_cast_stream_get_cursor_mode (MetaScreenCastStream *stream); diff --git a/src/backends/meta-screen-cast-window-stream.c b/src/backends/meta-screen-cast-window-stream.c index 4c235d150..6f42a446e 100644 --- a/src/backends/meta-screen-cast-window-stream.c +++ b/src/backends/meta-screen-cast-window-stream.c @@ -128,7 +128,7 @@ meta_screen_cast_window_stream_set_parameters (MetaScreenCastStream *stream, window_stream->logical_height)); } -static void +static gboolean meta_screen_cast_window_stream_transform_position (MetaScreenCastStream *stream, double stream_x, double stream_y, @@ -145,6 +145,7 @@ meta_screen_cast_window_stream_transform_position (MetaScreenCastStream *stream, stream_y, x, y); + return TRUE; } static void