From 487894b5bba974192d03cdf995cfc422f5e3f0d3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 17 Nov 2021 14:53:50 +0100 Subject: [PATCH] client: wayland: Move RDPEI assertion past RDPEI availability check The wlf_handle_touch_down() implements fallback to mouse event submission in case RDPEI is not available. This fallback is currently never reached, because the WINPR_ASSERT(rdpei); triggers before the fallback conditional is reached. Move the WINPR_ASSERT(rdpei); after the RDPEI availability check to permit the fallback to do its job. Signed-off-by: Marek Vasut --- client/Wayland/wlf_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/Wayland/wlf_input.c b/client/Wayland/wlf_input.c index ffb7a3db6..24442f037 100644 --- a/client/Wayland/wlf_input.c +++ b/client/Wayland/wlf_input.c @@ -473,7 +473,6 @@ BOOL wlf_handle_touch_down(freerdp* instance, const UwacTouchDown* ev) return FALSE; RdpeiClientContext* rdpei = wlf->rdpei; - WINPR_ASSERT(rdpei); // Emulate mouse click if touch is not possible, like in login screen if (!rdpei) @@ -492,6 +491,8 @@ BOOL wlf_handle_touch_down(freerdp* instance, const UwacTouchDown* ev) return FALSE; } + WINPR_ASSERT(rdpei); + WINPR_ASSERT(rdpei->TouchBegin); rdpei->TouchBegin(rdpei, touchId, x, y, &contactId);