Fix tests by checking if InputMethod::self() is null.
Only integration test has InputMethod instance.
This commit is contained in:
parent
d81b106c15
commit
6cc0c204fd
2 changed files with 9 additions and 2 deletions
|
@ -1494,7 +1494,12 @@ class InputKeyboardFilter : public InputEventFilter
|
|||
public:
|
||||
bool keyEvent(QKeyEvent *event) override
|
||||
{
|
||||
if (auto keyboardGrab = InputMethod::self()->keyboardGrab()) {
|
||||
auto *inputmethod = InputMethod::self();
|
||||
if (!inputmethod) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (auto keyboardGrab = inputmethod->keyboardGrab()) {
|
||||
if (event->isAutoRepeat()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -248,7 +248,9 @@ void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::Keyboa
|
|||
m_input->processFilters(std::bind(&InputEventFilter::keyEvent, std::placeholders::_1, &event));
|
||||
|
||||
m_xkb->forwardModifiers();
|
||||
InputMethod::self()->forwardModifiers(InputMethod::NoForce);
|
||||
if (auto *inputmethod = InputMethod::self()) {
|
||||
inputmethod->forwardModifiers(InputMethod::NoForce);
|
||||
}
|
||||
|
||||
if (event.modifiersRelevantForGlobalShortcuts() == Qt::KeyboardModifier::NoModifier && type != QEvent::KeyRelease) {
|
||||
m_keyboardLayout->checkLayoutChange(previousLayout);
|
||||
|
|
Loading…
Reference in a new issue