mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-11 10:56:25 +08:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user