Skip to content

Commit

Permalink
Fix window activation on trayicon click under KDE
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltca committed Mar 5, 2025
1 parent e685c96 commit b765e20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/modules/trayicon/libkvitrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ KviTrayIconWidget::KviTrayIconWidget()
setToolTipTitle("KVIrc");
setIconByPixmap(*g_pDock1);
setStandardActionsEnabled(false);
connect(this, SIGNAL(activateRequested(bool, QPoint)), this, SLOT(activatedSlot(bool)));
#else
setIcon(*g_pDock1);
connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(activatedSlot(QSystemTrayIcon::ActivationReason)));
Expand Down Expand Up @@ -481,10 +482,12 @@ void KviTrayIconWidget::refresh()
#endif
}

#ifndef COMPILE_KDE_SUPPORT
// Under Kde do nothing, KWin will restore/hide our window
// See ctor doc: KStatusNotifierItem::KStatusNotifierItem ( QObject * parent = nullptr )

#ifdef COMPILE_KDE_SUPPORT
void KviTrayIconWidget::activatedSlot(bool)
{
toggleParentFrame();
}
# else
void KviTrayIconWidget::activatedSlot(QSystemTrayIcon::ActivationReason reason)
{
switch(reason)
Expand Down
4 changes: 3 additions & 1 deletion src/modules/trayicon/libkvitrayicon.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ private slots:
void toggleParentFrame();
void doAway(bool);
void flashingTimerShot();
#ifndef COMPILE_KDE_SUPPORT
#ifdef COMPILE_KDE_SUPPORT
void activatedSlot(bool active);
# else
void activatedSlot(QSystemTrayIcon::ActivationReason reason);
#endif
void executeInternalCommand(bool);
Expand Down

0 comments on commit b765e20

Please sign in to comment.