[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    ksystraycmd (kde4)
From:       Sergey Saukh <thelich () yandex ! ru>
Date:       2008-04-23 5:37:44
Message-ID: 200804231237.55550.thelich () yandex ! ru
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Hello,

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

-- 
Best regards,
Sergey A Saukh

["ksystraycmd.diff" (text/x-diff)]

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;


["signature.asc" (application/pgp-signature)]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic