Web lists-archives.org

ksystraycmd (kde4)




Hello,

Small patch, which makes ksystraycmd to work as it should (clicking on tray 
icon hides/show application).

-- 
Best regards,
Sergey A Saukh
diff -ubEr ksystraycmd.orig/ksystraycmd.cpp ksystraycmd/ksystraycmd.cpp
--- ksystraycmd.orig/ksystraycmd.cpp	2008-03-09 19:48:40.000000000 +0600
+++ ksystraycmd/ksystraycmd.cpp	2008-04-23 10:32:07.000000000 +0700
@@ -28,6 +28,7 @@
     isVisible(true), lazyStart( false ), noquit( false ), quitOnHide( false ), onTop(false), ownIcon(false),
     win(0), client(0), top(0), left(0)
 {
+  connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(mousePressEvent(QSystemTrayIcon::ActivationReason)));
   refresh();
 }
 
@@ -281,11 +282,12 @@
 // Tray icon event handlers
 //
 
-void KSysTrayCmd::mousePressEvent( QMouseEvent *e )
+void KSysTrayCmd::mousePressEvent( QSystemTrayIcon::ActivationReason reason )
 {
-  if ( e->button() == Qt::RightButton )
-    execContextMenu( e->globalPos() );
-  else if ( lazyStart && ( !hasRunningClient() ) )
+//  if ( e->button() == Qt::RightButton )
+//    execContextMenu( e->globalPos() );
+//  else if ( lazyStart && ( !hasRunningClient() ) )
+  if ( lazyStart && ( !hasRunningClient() ) )
   {
     start();
     isVisible=true;
@@ -296,7 +298,7 @@
     ri.closeWindowRequest( win );
     isVisible=false;
   }
-  else
+  else if ( reason == QSystemTrayIcon::Trigger )
     toggleWindow();
 }
 
diff -ubEr ksystraycmd.orig/ksystraycmd.h ksystraycmd/ksystraycmd.h
--- ksystraycmd.orig/ksystraycmd.h	2008-03-09 19:48:40.000000000 +0600
+++ ksystraycmd/ksystraycmd.h	2008-04-23 10:11:32.000000000 +0700
@@ -54,13 +54,12 @@
 
   void windowAdded(WId w);
   void windowChanged(WId w);
+  void mousePressEvent(QSystemTrayIcon::ActivationReason reason);
 
 protected:
   bool startClient();
   void checkExistingWindows();
 
-  void mousePressEvent( QMouseEvent *e );
-
 private:
   QString command;
   QString window;

Attachment: signature.asc
Description: This is a digitally signed message part.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<