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 <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
David Edmundson 2023-06-07 17:30:30 +01:00
parent 7a93643df7
commit ad0e538664

View File

@ -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;