Commit 04845b60 authored by David Edmundson's avatar David Edmundson
Browse files

[wayland] Avoid compare to unintialised value in keyboard repeat

Summary:
If we get a key event for which

if (m_xkb->shouldKeyRepeat(key) &&
waylandServer()->seat()->keyRepeatDelay() != 0) fails

m_key will be unitialised and on release we have a compare against
unitialised memory.

Won't do any harm, it'll just stop a timer that isn't running, but
valgrind complains.

0 is the value QKeyEvent uses when nativeScanCode is unknown so a safe
initial values.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23748
parent a209ee78
......@@ -47,7 +47,7 @@ private:
QTimer *m_timer;
Xkb *m_xkb;
quint32 m_time;
quint32 m_key;
quint32 m_key = 0;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment