diff --git a/kate/kateapp.cpp b/kate/kateapp.cpp --- a/kate/kateapp.cpp +++ b/kate/kateapp.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -162,7 +163,13 @@ } // notify about start - KStartupInfo::setNewStartupId(activeKateMainWindow(), KStartupInfo::startupId()); + QWidget *win = activeKateMainWindow(); +#if KWINDOWSYSTEM_VERSION >= QT_VERSION_CHECK(5,62,0) + win->setAttribute(Qt::WA_NativeWindow, true); + KStartupInfo::setNewStartupId(win->windowHandle(), KStartupInfo::startupId()); +#else + KStartupInfo::setNewStartupId(win, KStartupInfo::startupId()); +#endif QTextCodec *codec = m_args.isSet(QStringLiteral("encoding")) ? QTextCodec::codecForName(m_args.value(QStringLiteral("encoding")).toUtf8()) : nullptr; bool tempfileSet = m_args.isSet(QStringLiteral("tempfile")); diff --git a/kate/kateappadaptor.cpp b/kate/kateappadaptor.cpp --- a/kate/kateappadaptor.cpp +++ b/kate/kateappadaptor.cpp @@ -27,6 +27,7 @@ #include #include +#include #include @@ -53,7 +54,12 @@ win->activateWindow(); // try to raise window, see bug 407288 +#if KWINDOWSYSTEM_VERSION >= QT_VERSION_CHECK(5,62,0) + win->setAttribute(Qt::WA_NativeWindow, true); + KStartupInfo::setNewStartupId(win->windowHandle(), KStartupInfo::startupId()); +#else KStartupInfo::setNewStartupId(win, KStartupInfo::startupId()); +#endif KWindowSystem::activateWindow(win->effectiveWinId()); }