[Konversation-devel] [Bug 247263] Konversation lacks a shortcut to Toggle Main Window

Eike Hein hein at kde.org
Tue Aug 10 21:52:19 CEST 2010


https://bugs.kde.org/show_bug.cgi?id=247263





--- Comment #5 from Eike Hein <hein kde org>  2010-08-10 21:49:26 ---
commit 65f91b9e833dc40e0b3e093dec06d173f9929afa
Author: Eike Hein <hein at kde.org>
Date:   Tue Aug 10 21:49:21 2010 +0200

    Handle another scenario.

    BUG:247263

diff --git a/ChangeLog b/ChangeLog
index ffe288a..c500b5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -119,7 +119,10 @@ Changes since 1.3.1:
 * Fixed a number of crashes on illegal data from the server.
 * Added a "Show/Hide Konversation" action that can be used to toggle the
   minimized state of the Konversation window or, if the tray icon is enabled,
-  its visibility.
+  its visibility. Additionally, the window will always be moved to the
+  current virtual desktop if shown using this action (if the window is
+  already shown on another desktop, it will be moved to the current desktop
+  rather than hidden).


 Changes from 1.3 to 1.3.1:
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8dc435e..ec2f5a6 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -860,10 +860,20 @@ void MainWindow::toggleVisibility()
     }
     else if (isVisible())
     {
-        if (Preferences::self()->showTrayIcon())
-            hide();
+        bool onCurrentDesktop = KWindowSystem::windowInfo(winId(),
NET::WMDesktop).isOnCurrentDesktop();
+
+        if (onCurrentDesktop)
+        {
+            if (Preferences::self()->showTrayIcon())
+                hide();
+            else
+                KWindowSystem::minimizeWindow(winId());
+        }
         else
-            KWindowSystem::minimizeWindow(winId());
+        {
+            KWindowSystem::setOnDesktop(winId(),
KWindowSystem::currentDesktop());
+            KWindowSystem::activateWindow(winId());
+        }
     }
     else if (Preferences::self()->showTrayIcon())
     {

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Konversation-devel mailing list