killer: Initialize Xdg Importer in its constructor

Avoids having to do asynchronous code further down.
This commit is contained in:
Kai Uwe Broulik 2024-02-04 16:56:55 +01:00 committed by Vlad Zahorodnii
parent fec39141b5
commit 68f1684031

View file

@ -50,6 +50,7 @@ public:
XdgImporter()
: QWaylandClientExtensionTemplate(1)
{
initialize();
}
~XdgImporter() override
{
@ -223,8 +224,7 @@ int main(int argc, char *argv[])
dialog->show();
auto setTransientParent = [&xdgImporter, &importedParent, dialog, windowHandle] {
if (xdgImporter->isActive()) {
if (xdgImporter) {
if (auto *waylandWindow = dialog->windowHandle()->nativeInterface<QNativeInterface::Private::QWaylandWindow>()) {
importedParent.reset(xdgImporter->import(windowHandle));
if (auto *surface = waylandWindow->surface()) {
@ -232,12 +232,6 @@ int main(int argc, char *argv[])
}
}
}
};
if (xdgImporter) {
QObject::connect(xdgImporter.get(), &XdgImporter::activeChanged, dialog, setTransientParent);
setTransientParent();
}
dialog->windowHandle()->requestActivate();