mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-04 23:27:58 +02:00
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>
This commit is contained in:
parent
7f10997d92
commit
873ec15412
1 changed files with 19 additions and 0 deletions
|
|
@ -1050,17 +1050,35 @@ static BOOL
|
|||
xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
|
||||
{
|
||||
RdpPeerContext *peerContext = (RdpPeerContext *)input->context;
|
||||
uint32_t button = 0;
|
||||
bool need_frame = false;
|
||||
struct rdp_output *output;
|
||||
struct timespec time;
|
||||
|
||||
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;
|
||||
if (x < output->base.width && y < output->base.height) {
|
||||
weston_compositor_get_time(&time);
|
||||
notify_motion_absolute(peerContext->item.seat, &time, x, y);
|
||||
need_frame = true;
|
||||
}
|
||||
|
||||
if (need_frame)
|
||||
notify_pointer_frame(peerContext->item.seat);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1206,6 +1224,7 @@ rdp_peer_init(freerdp_peer *client, struct rdp_backend *b)
|
|||
settings->NSCodec = TRUE;
|
||||
settings->FrameMarkerCommandEnabled = TRUE;
|
||||
settings->SurfaceFrameMarkerEnabled = TRUE;
|
||||
settings->HasExtendedMouseEvent = TRUE;
|
||||
|
||||
client->Capabilities = xf_peer_capabilities;
|
||||
client->PostConnect = xf_peer_post_connect;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue