mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
Merge pull request #7579 from Morph1984/swkbd-oob-array-access
qt_software_keyboard: Fix out of bounds array access
This commit is contained in:
commit
f0ed11e318
@ -475,11 +475,26 @@ void QtSoftwareKeyboardDialog::open() {
|
|||||||
row = 0;
|
row = 0;
|
||||||
column = 0;
|
column = 0;
|
||||||
|
|
||||||
const auto* const curr_button =
|
switch (bottom_osk_index) {
|
||||||
keyboard_buttons[static_cast<int>(bottom_osk_index)][row][column];
|
case BottomOSKIndex::LowerCase:
|
||||||
|
case BottomOSKIndex::UpperCase: {
|
||||||
|
const auto* const curr_button =
|
||||||
|
keyboard_buttons[static_cast<std::size_t>(bottom_osk_index)][row][column];
|
||||||
|
|
||||||
// This is a workaround for setFocus() randomly not showing focus in the UI
|
// This is a workaround for setFocus() randomly not showing focus in the UI
|
||||||
QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
|
QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BottomOSKIndex::NumberPad: {
|
||||||
|
const auto* const curr_button = numberpad_buttons[row][column];
|
||||||
|
|
||||||
|
// This is a workaround for setFocus() randomly not showing focus in the UI
|
||||||
|
QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
StartInputThread();
|
StartInputThread();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user