If available, use KDE API to force window activation.
authorAurélien Gâteau <agateau@kde.org>
Wed, 14 Oct 2009 13:35:46 +0000 (15:35 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 14 Oct 2009 20:23:43 +0000 (22:23 +0200)
src/qtui/mainwin.cpp

index 963f7a2..b3f1942 100644 (file)
@@ -27,6 +27,7 @@
 #  include <KShortcutsDialog>
 #  include <KStatusBar>
 #  include <KToolBar>
+#  include <KWindowSystem>
 #endif
 
 #ifdef Q_WS_X11
@@ -964,6 +965,11 @@ void MainWin::toggleMinimizedToTray() {
 }
 
 void MainWin::forceActivated() {
+#ifdef HAVE_KDE
+  show();
+  KWindowSystem::forceActiveWindow(winId());
+#else
+
 #ifdef Q_WS_X11
   // Bypass focus stealing prevention
   QX11Info::setAppUserTime(QX11Info::appTime());
@@ -979,6 +985,7 @@ void MainWin::forceActivated() {
   show();
   raise();
   activateWindow();
+#endif /* HAVE_KDE */
 }
 
 void MainWin::messagesInserted(const QModelIndex &parent, int start, int end) {