Reset stored window before setting it as focused pointer surface on seat
Updating the focused pointer surface results in the cursor to change. The CursorImage needs the current focused window to evaluate which cursor to use, though. Thus we need to make sure that the window reflects the current state before updating the seat.
This commit is contained in:
parent
d15e94f326
commit
b6677ca04e
2 changed files with 2 additions and 7 deletions
|
@ -811,7 +811,6 @@ void PointerInputTest::testCursorImage()
|
||||||
// move cursor to center of window, this should first set a null pointer
|
// move cursor to center of window, this should first set a null pointer
|
||||||
Cursor::setPos(window->geometry().center());
|
Cursor::setPos(window->geometry().center());
|
||||||
QCOMPARE(p->window().data(), window);
|
QCOMPARE(p->window().data(), window);
|
||||||
QEXPECT_FAIL("", "Fix me", Continue);
|
|
||||||
QVERIFY(p->cursorImage().isNull());
|
QVERIFY(p->cursorImage().isNull());
|
||||||
QVERIFY(enteredSpy.wait());
|
QVERIFY(enteredSpy.wait());
|
||||||
|
|
||||||
|
@ -854,7 +853,6 @@ void PointerInputTest::testCursorImage()
|
||||||
// move cursor somewhere else, should reset to fallback cursor
|
// move cursor somewhere else, should reset to fallback cursor
|
||||||
Cursor::setPos(window->geometry().bottomLeft() + QPoint(20, 20));
|
Cursor::setPos(window->geometry().bottomLeft() + QPoint(20, 20));
|
||||||
QVERIFY(p->window().isNull());
|
QVERIFY(p->window().isNull());
|
||||||
QEXPECT_FAIL("", "Fix me", Continue);
|
|
||||||
QVERIFY(!p->cursorImage().isNull());
|
QVERIFY(!p->cursorImage().isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,6 +256,7 @@ void PointerInputRedirection::update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (t && t->surface()) {
|
if (t && t->surface()) {
|
||||||
|
m_window = QPointer<Toplevel>(t);
|
||||||
seat->setFocusedPointerSurface(t->surface(), t->inputTransformation());
|
seat->setFocusedPointerSurface(t->surface(), t->inputTransformation());
|
||||||
m_windowGeometryConnection = connect(t, &Toplevel::geometryChanged, this,
|
m_windowGeometryConnection = connect(t, &Toplevel::geometryChanged, this,
|
||||||
[this] {
|
[this] {
|
||||||
|
@ -275,14 +276,10 @@ void PointerInputRedirection::update()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
m_window.clear();
|
||||||
seat->setFocusedPointerSurface(nullptr);
|
seat->setFocusedPointerSurface(nullptr);
|
||||||
t = nullptr;
|
t = nullptr;
|
||||||
}
|
}
|
||||||
if (!t) {
|
|
||||||
m_window.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_window = QPointer<Toplevel>(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointerInputRedirection::updateInternalWindow()
|
void PointerInputRedirection::updateInternalWindow()
|
||||||
|
|
Loading…
Reference in a new issue