diff --git a/autotests/wayland/pointer_input.cpp b/autotests/wayland/pointer_input.cpp index 6e54b70b14..982d575d89 100644 --- a/autotests/wayland/pointer_input.cpp +++ b/autotests/wayland/pointer_input.cpp @@ -909,7 +909,6 @@ void PointerInputTest::testEffectOverrideCursorImage() const QImage openHand = p->cursorImage(); QVERIFY(!openHand.isNull()); QVERIFY(openHand != fallback); - QEXPECT_FAIL("", "Fix me", Continue); QVERIFY(leftSpy.wait()); // let's change to arrow cursor, this should be our fallback @@ -924,7 +923,6 @@ void PointerInputTest::testEffectOverrideCursorImage() Cursor::setPos(800, 800); // and end the override, which should switch to fallback effects->stopMouseInterception(effect.data()); - QEXPECT_FAIL("", "Fix me", Continue); QCOMPARE(p->cursorImage(), fallback); // start mouse interception again @@ -938,7 +936,6 @@ void PointerInputTest::testEffectOverrideCursorImage() // after ending the interception we should get an enter event effects->stopMouseInterception(effect.data()); - QEXPECT_FAIL("", "Fix me", Continue); QVERIFY(enteredSpy.wait()); QVERIFY(p->cursorImage().isNull()); } diff --git a/input.cpp b/input.cpp index 2b9598225e..1118fda195 100644 --- a/input.cpp +++ b/input.cpp @@ -1022,6 +1022,10 @@ Toplevel *InputRedirection::findToplevel(const QPoint &pos) const bool isScreenLocked = waylandServer() && waylandServer()->isScreenLocked(); // TODO: check whether the unmanaged wants input events at all if (!isScreenLocked) { + // if an effect overrides the cursor we don't have a window to focus + if (effects && static_cast(effects)->isMouseInterception()) { + return nullptr; + } const UnmanagedList &unmanaged = Workspace::self()->unmanagedList(); foreach (Unmanaged *u, unmanaged) { if (u->geometry().contains(pos) && acceptsInput(u, pos)) { diff --git a/pointer_input.cpp b/pointer_input.cpp index 729df1ec01..ef2d8145ed 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -487,6 +487,8 @@ void PointerInputRedirection::setEffectsOverrideCursor(Qt::CursorShape shape) if (!m_inited) { return; } + // current pointer focus window should get a leave event + update(); m_cursor->setEffectsOverrideCursor(shape); } @@ -495,6 +497,8 @@ void PointerInputRedirection::removeEffectsOverrideCursor() if (!m_inited) { return; } + // cursor position might have changed while there was an effect in place + update(); m_cursor->removeEffectsOverrideCursor(); }