From ad0e53866446173624f3d2f6b73a64d2375bbb26 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 7 Jun 2023 17:30:30 +0100 Subject: [PATCH] client: initialize key repeat information We can end up checking mRepeatKey.code before getting a key press is recorded when the values are uninitialized. This can happen if we get a key up for a previously held key or if key repeats are disabled. It's relatively harmless as it just stops a timer, but it can show up in valgrind logs. Change-Id: Ib7fe58b1976e9c89550c5a6252a34d66f83e2481 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/wayland/qwaylandinputdevice_p.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h index fce6e74cf8c..3f19f2b2151 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h +++ b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h @@ -230,13 +230,13 @@ public: uint32_t mNativeModifiers = 0; struct repeatKey { - int key; - uint32_t code; - uint32_t time; + int key = 0; + uint32_t code = 0; + uint32_t time = 0 ; QString text; Qt::KeyboardModifiers modifiers; - uint32_t nativeVirtualKey; - uint32_t nativeModifiers; + uint32_t nativeVirtualKey = 0; + uint32_t nativeModifiers = 0; } mRepeatKey; QTimer mRepeatTimer;