Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9
-
None
-
Fedora 41, KDE Plasma
Description
Consider the following code:
#include <QApplication> #include <QMainWindow> #include <QPushButton> #include <QLayout> int main(int argc, char**argv) { QApplication app(argc, argv); auto window1 = new QMainWindow; window1->setCursor(QCursor(Qt::OpenHandCursor)); auto window2 = new QMainWindow; window2->setCursor(QCursor(Qt::PointingHandCursor)); auto button = new QPushButton(window2); button->setText("Do override"); button->setCheckable(true); window2->layout()->addWidget(button); QObject::connect(button, &QPushButton::toggled, window1, [](bool checked){ if (checked) { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); } else { QApplication::restoreOverrideCursor(); } }); window1->show(); window2->show(); return app.exec(); }
The two windows have a different cursor, the one with the button has a pointing cursor whereas the empty one has an open hand cursor.
Clicking the button sets an override cursor, and clicking it again restores the original cursor.
On Wayland that does not work correctly, now the window with the button has the cursor from the other window. Only after some interaction (e.g. leaving and re-entering the window) the right cursor returns.
It works as expected with xcb