[konqueror] [Bug 500173] Spurious windows while generating HTML preview in Wayland
Stefano Crocco
bugzilla_noreply at kde.org
Sun Feb 23 10:33:10 GMT 2025
https://bugs.kde.org/show_bug.cgi?id=500173
--- Comment #12 from Stefano Crocco <stefano.crocco at alice.it> ---
(In reply to Nicolas Fella from comment #9)
> I can reproduce with this program. I haven't really tried to reproduce it
> without a QWebEngineView, but it might be possible
>
> #include <QApplication>
> #include <QTimer>
> #include <QUrl>
> #include <QWebEngineView>
>
> int main(int argc, char **argv) {
> QApplication app(argc, argv);
>
> QTimer::singleShot(0, [&app] {
> const QUrl indexUrl =
> QUrl::fromLocalFile("/home/nico/doc/html/bluezqt-adapter.html");
>
> bool rendered = false;
>
> QWebEngineView view;
> QObject::connect(&view, &QWebEngineView::loadFinished, [&rendered] {
> QTimer::singleShot(1000, [&rendered] { rendered = true; });
> });
>
> view.resize(500, 500);
>
> view.load(indexUrl);
> view.setAttribute(Qt::WA_OutsideWSRange);
> view.setWindowFlags(view.windowFlags() | Qt::BypassWindowManagerHint |
> Qt::FramelessWindowHint);
> view.move(5000, 5000);
> view.show();
>
> while (!rendered)
> qApp->processEvents(QEventLoop::WaitForMoreEvents);
>
> QPixmap pix(500, 500);
> pix.fill(QColor(245, 245, 245));
>
> view.render(&pix);
> view.hide();
> app.quit();
> });
>
> return app.exec();
> }
It seems that the issue is related to the Qt::WA_OutsideWSRange window
attribute and that moving the window has no effect at all. I could reproduce
the issue with the following program:
int main(int argc, char **argv) {
QApplication app(argc, argv);
QWidget *mw = new QWidget();
QVBoxLayout *l = new QVBoxLayout(mw);
mw->setLayout(l);
QCheckBox *check = new QCheckBox("Enable WA_OutsideWSRange", mw);
l->addWidget(check);
QPushButton *btn = new QPushButton("show window", mw);
l->addWidget(btn);
auto showWindow = [&]() {
QWidget *widget = new QWidget;
if (check->isChecked()) {
widget->setAttribute(Qt::WA_OutsideWSRange);
}
widget->show();
};
QObject::connect(btn, &QPushButton::clicked, mw, showWindow);
mw->show();
app.exec();
return 0;
}
It just shows a check box and a button: when the button is pressed, a new
toplevel widget is shown. If the checkbox is checked, the Qt::WA_OutsideWSRange
attribute is set on the widget before showing it. With Qt 6.8.2, the new widget
is always shown, while with Qt 6.8.0 (in the virtual machine) the widget is
only shown when the checkbox is not checked. I don't know whether this is
caused by the change in Qt version or in the Wayland version, since the virtual
machine has version 1.23.0 while the real machine has 1.23.1.
In any case, I created a Qt bug report:
https://bugreports.qt.io/browse/QTBUG-134012
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the kfm-devel
mailing list