Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.7
-
None
Description
Here is the minimal example that reproduces the problem:
#include <QtWidgets> #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); QDialog *dialog = new QDialog(); QHBoxLayout *layout = new QHBoxLayout(dialog); QLineEdit *lineedit = new QLineEdit(dialog); layout->addWidget(lineedit); dialog->setLayout(layout); dialog->setWindowFlags(Qt::Popup); dialog->setAttribute(Qt::WA_QuitOnClose); dialog->show(); lineedit->setFocus(); return app.exec(); }
Running the app from terminal gives no surprises. But if I make an OS shortcut that launches this app, more often than not I end up with the dialog sticking on top of all windows and with blinking cursor waiting there for user's input, but ignoring the input entirely. Instead, the input goes to another app that was previously in focus, and I have to resort to terminal to kill the app.
Checked with Qt version 5.12.7 on two different hosts with Ubuntu 18.04 and 19.10. It also does not depend on DE/window manager - I tried to assign shortcuts to launch the app in Gnome, xfce and i3 - the situation is the same. Also tried in Sway, a Wayland-based tiling window manager, but with XWayland backend - the same thing. (Using the app in Sway with normal wayland backend causes no input issue, but the dialog gets tiled like other regular windows despite its popup attribute - a topic probably for another issue).
Also tried to use dialog->raise() and dialog->windowActivate(), but they made no difference.