Set associated window for tray icon
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "trayicon_sni.h"
|
||||
#include <KWindowSystem>
|
||||
|
||||
#include "windowcontroller.h"
|
||||
|
||||
TrayIcon::TrayIcon(QObject *parent)
|
||||
: KStatusNotifierItem(parent)
|
||||
{
|
||||
@@ -13,6 +15,12 @@ TrayIcon::TrayIcon(QObject *parent)
|
||||
KWindowSystem::setCurrentXdgActivationToken(providedToken());
|
||||
Q_EMIT showWindow();
|
||||
});
|
||||
|
||||
connect(&WindowController::instance(), &WindowController::windowChanged, this, [this] {
|
||||
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
||||
setAssociatedWindow(WindowController::instance().window());
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
void TrayIcon::show()
|
||||
|
||||
Reference in New Issue
Block a user