rdp: Fix up xf_extendedMouseEvent

These events carry the 4th and 5th mouse buttons, so
we should propagate them. We also need to use pointer
frames to ensure the buttons are properly paired with
the pointer co-ordinates.

Unfortunately, there is no way in RDP to determine if
a mouse event and an extended mouse event should be in
the same pointer frame, so this is the best we can do.

We also enable extended mouse events so they'll be used.

Co-authored-by: Steve Pronovost <spronovo@microsoft.com>
Co-authored-by: Brenton DeGeer <brdegeer@microsoft.com>
Signed-off-by: Hideyuki Nagase <hideyukn@microsoft.com>
Signed-off-by: Steve Pronovost <spronovo@microsoft.com>
Signed-off-by: Brenton DeGeer <brdegeer@microsoft.com>
dev
Hideyuki Nagase 3 years ago committed by Derek Foreman
parent 7f10997d92
commit 873ec15412
  1. 19
      libweston/backend-rdp/rdp.c

@ -1050,17 +1050,35 @@ static BOOL
xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
{ {
RdpPeerContext *peerContext = (RdpPeerContext *)input->context; RdpPeerContext *peerContext = (RdpPeerContext *)input->context;
uint32_t button = 0;
bool need_frame = false;
struct rdp_output *output; struct rdp_output *output;
struct timespec time; struct timespec time;
dump_mouseinput(peerContext, flags, x, y, true); dump_mouseinput(peerContext, flags, x, y, true);
if (flags & PTR_XFLAGS_BUTTON1)
button = BTN_SIDE;
else if (flags & PTR_XFLAGS_BUTTON2)
button = BTN_EXTRA;
if (button) {
weston_compositor_get_time(&time);
notify_button(peerContext->item.seat, &time, button,
(flags & PTR_XFLAGS_DOWN) ? WL_POINTER_BUTTON_STATE_PRESSED : WL_POINTER_BUTTON_STATE_RELEASED);
need_frame = true;
}
output = peerContext->rdpBackend->output; output = peerContext->rdpBackend->output;
if (x < output->base.width && y < output->base.height) { if (x < output->base.width && y < output->base.height) {
weston_compositor_get_time(&time); weston_compositor_get_time(&time);
notify_motion_absolute(peerContext->item.seat, &time, x, y); notify_motion_absolute(peerContext->item.seat, &time, x, y);
need_frame = true;
} }
if (need_frame)
notify_pointer_frame(peerContext->item.seat);
return TRUE; return TRUE;
} }
@ -1206,6 +1224,7 @@ rdp_peer_init(freerdp_peer *client, struct rdp_backend *b)
settings->NSCodec = TRUE; settings->NSCodec = TRUE;
settings->FrameMarkerCommandEnabled = TRUE; settings->FrameMarkerCommandEnabled = TRUE;
settings->SurfaceFrameMarkerEnabled = TRUE; settings->SurfaceFrameMarkerEnabled = TRUE;
settings->HasExtendedMouseEvent = TRUE;
client->Capabilities = xf_peer_capabilities; client->Capabilities = xf_peer_capabilities;
client->PostConnect = xf_peer_post_connect; client->PostConnect = xf_peer_post_connect;

Loading…
Cancel
Save