mirror of https://github.com/debauchee/barrier.git
fixed bug that caused the wrong keycode to be used for most,
possibly all, keysyms. was reading past the end of an array of keysyms.
This commit is contained in:
parent
e4c29179d9
commit
7f21588e9b
|
@ -917,7 +917,7 @@ void
|
|||
CXWindowsSecondaryScreen::updateKeycodeMap(Display* display)
|
||||
{
|
||||
// there are up to 4 keysyms per keycode
|
||||
static const int numKeysyms = 4;
|
||||
static const int maxKeysyms = 4;
|
||||
|
||||
// get the number of keycodes
|
||||
int minKeycode, maxKeycode;
|
||||
|
@ -930,6 +930,12 @@ CXWindowsSecondaryScreen::updateKeycodeMap(Display* display)
|
|||
minKeycode, numKeycodes,
|
||||
&keysymsPerKeycode);
|
||||
|
||||
// we only understand up to maxKeysyms keysyms per keycodes
|
||||
int numKeysyms = keysymsPerKeycode;
|
||||
if (numKeysyms > maxKeysyms) {
|
||||
numKeysyms = maxKeysyms;
|
||||
}
|
||||
|
||||
// initialize
|
||||
KeyCodeMask entry;
|
||||
m_keycodeMap.clear();
|
||||
|
|
Loading…
Reference in New Issue