Skip to content

Commit

Permalink
Gui: fix crash on shortcut resolving time out
Browse files Browse the repository at this point in the history
Related #978
  • Loading branch information
realthunder committed May 28, 2024
1 parent f2f9ced commit 9a2b381
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Gui/ShortcutManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,10 @@ void ShortcutManager::onTimer()
if (it->key.shortcut != k) {
QKeyEvent keyPress(QEvent::KeyPress, s, Qt::ControlModifier, 0, 0, 0);
QApplication::sendEvent(lastFocus, &keyPress);
QKeyEvent keyRelease(QEvent::KeyRelease, s, Qt::ControlModifier, 0, 0, 0);
QApplication::sendEvent(lastFocus, &keyRelease);
if (lastFocus) {
QKeyEvent keyRelease(QEvent::KeyRelease, s, Qt::ControlModifier, 0, 0, 0);
QApplication::sendEvent(lastFocus, &keyRelease);
}
break;
}
}
Expand Down

0 comments on commit 9a2b381

Please sign in to comment.