blob: 1a424ef98c371b488d98c05d66c14523bf709e2c (
plain) (
tree)
|
|
From 9611a8b3e09f7ae4b53640c11a2196274f39d60f Mon Sep 17 00:00:00 2001
From: David Faure <faure@kde.org>
Date: Sun, 10 Nov 2019 14:28:36 +0100
Subject: port away from deprecated methods in KWindowSystem >= 5.62
(this is in order to make KWindowSystem independent from QtWidgets)
---
plan/src/workpackage/commandlineparser.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plan/src/workpackage/commandlineparser.cpp b/plan/src/workpackage/commandlineparser.cpp
index 432f99a..f9be208 100644
--- a/plan/src/workpackage/commandlineparser.cpp
+++ b/plan/src/workpackage/commandlineparser.cpp
@@ -28,6 +28,7 @@
#include <KStartupInfo>
#include <KWindowSystem>
#include <KMessageBox>
+#include <kwindowsystem_version.h>
#include <QApplication>
#include <QDir>
@@ -65,7 +66,12 @@ void CommandLineParser::handleActivateRequest(const QStringList &arguments, cons
handleCommandLine(QDir(workingDirectory));
// terminate startup notification and activate the mainwindow
+#if KWINDOWSYSTEM_VERSION >= QT_VERSION_CHECK(5,62,0)
+ m_mainwindow->setAttribute(Qt::WA_NativeWindow, true);
+ KStartupInfo::setNewStartupId(m_mainwindow->windowHandle(), KStartupInfo::startupId());
+#else
KStartupInfo::setNewStartupId(m_mainwindow, KStartupInfo::startupId());
+#endif
KWindowSystem::forceActiveWindow(m_mainwindow->winId());
}
--
cgit v1.1
|