From b6fc6b2a8d781cd22f4b56c5394976e20f835aef Mon Sep 17 00:00:00 2001 From: Hideyuki Nagase Date: Wed, 16 Mar 2022 13:21:33 -0500 Subject: [PATCH] rdp: sync keylocks on synchronize event Synchronize events carry keylock status, so we should update it. Co-authored-by: Steve Pronovost Co-authored-by: Brenton DeGeer Signed-off-by: Hideyuki Nagase Signed-off-by: Steve Pronovost Signed-off-by: Brenton DeGeer --- libweston/backend-rdp/rdp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c index bde4653f..61b920f2 100644 --- a/libweston/backend-rdp/rdp.c +++ b/libweston/backend-rdp/rdp.c @@ -1237,6 +1237,7 @@ xf_input_synchronize_event(rdpInput *input, UINT32 flags) RdpPeerContext *peerCtx = (RdpPeerContext *)input->context; struct rdp_backend *b = peerCtx->rdpBackend; struct rdp_output *output = peerCtx->rdpBackend->output; + struct weston_keyboard *keyboard; pixman_box32_t box; pixman_region32_t damage; @@ -1247,6 +1248,19 @@ xf_input_synchronize_event(rdpInput *input, UINT32 flags) flags & KBD_SYNC_CAPS_LOCK ? 1 : 0, flags & KBD_SYNC_KANA_LOCK ? 1 : 0); + keyboard = weston_seat_get_keyboard(peerCtx->item.seat); + if (keyboard) { + uint32_t value = 0; + + if (flags & KBD_SYNC_NUM_LOCK) + value |= WESTON_NUM_LOCK; + if (flags & KBD_SYNC_CAPS_LOCK) + value |= WESTON_CAPS_LOCK; + weston_keyboard_set_locks(keyboard, + WESTON_NUM_LOCK | WESTON_CAPS_LOCK, + value); + } + /* sends a full refresh */ box.x1 = 0; box.y1 = 0;