[gnome-remote-desktop] rdp-pipewire-stream: Stop warping the mouse pointer



commit 74d28f611dda6233742e186e9ecc865dd959f13e
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Mon Mar 8 19:32:37 2021 +0100

    rdp-pipewire-stream: Stop warping the mouse pointer
    
    With the release of PipeWire-0.3.23, PipeWire fixed some screencasting
    issues.
    One of them is that PipeWire now always submits the mouse pointer
    position correctly.
    Currently, the RDP backend used the PointerPosition update to inform
    the RDP client of the mouse pointer position on the server side.
    The intention was that for remote assistance sessions, the user on the
    client side could see the mouse pointer of the user on the server side,
    when the user on the server side move the mouse.
    
    The reality apparently is that this PDU literally means "Warp the mouse
    pointer on the client side to this position".
    This has several downsides:
    First, the original intention of just informing the RDP client about
    the mouse pointer position cannot be fulfilled any more.
    Second, the RDP client should not simply move the mouse pointer bitmap,
    just because the server told the client to do so.
    In most situations, this is just a security issue.
    Third, sending the mouse pointer position via the PointerPosition
    update has another negative effect:
    Depending how the RDP client handles the update, the user on the client
    side can only hardly move the mouse pointer and in some cases, if the
    user decides to move a window, the whole window jitters.
    
    With PipeWire-0.3.23, this issue really becomes apparent, since
    PipeWire now always carries the correct mouse pointer position, which
    has the effect that a lot of PointerPosition updates happen.
    
    So, to solve this situation, don't send any PointerPosition updates any
    more that are based on the mouse pointer position of the last frame(s).
    For remote assistance sessions, gnome-remote-desktop can later indicate
    the mouse pointer position by blitting the current mouse pointer onto
    the target surface.

 src/grd-rdp-pipewire-stream.c | 12 ------------
 1 file changed, 12 deletions(-)
---
diff --git a/src/grd-rdp-pipewire-stream.c b/src/grd-rdp-pipewire-stream.c
index f0c1b42..09015e7 100644
--- a/src/grd-rdp-pipewire-stream.c
+++ b/src/grd-rdp-pipewire-stream.c
@@ -50,9 +50,6 @@ typedef struct _GrdRdpFrame
   uint16_t pointer_width;
   uint16_t pointer_height;
   gboolean pointer_is_hidden;
-  bool pointer_moved;
-  uint16_t pointer_x;
-  uint16_t pointer_y;
 } GrdRdpFrame;
 
 struct _GrdRdpPipeWireStream
@@ -254,11 +251,6 @@ do_render (struct spa_loop *loop,
       grd_session_rdp_hide_pointer (stream->session_rdp);
     }
 
-  if (frame->pointer_moved)
-    grd_session_rdp_move_pointer (stream->session_rdp,
-                                  frame->pointer_x,
-                                  frame->pointer_y);
-
   g_free (frame);
 
   return 0;
@@ -384,10 +376,6 @@ process_buffer (GrdRdpPipeWireStream *stream,
         {
           frame->pointer_is_hidden = TRUE;
         }
-
-      frame->pointer_moved = true;
-      frame->pointer_x = spa_meta_cursor->position.x;
-      frame->pointer_y = spa_meta_cursor->position.y;
     }
 
   return g_steal_pointer (&frame);


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