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

List:       kde-commits
Subject:    kdebase
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2005-03-02 17:14:42
Message-ID: 20050302171442.BC1DC148A2 () office ! kde ! org
[Download RAW message or body]

CVS commit by ossi: 

lock current session when switching away. unlike starting a new session,
switching can be done without this menu, so i suppose locking always is
ok.
might be worth a backport.


  M +2 -2      kdesktop/krootwm.cc   1.215
  M +10 -2     kdmlib/dmctl.cpp   1.8
  M +2 -1      kdmlib/dmctl.h   1.6
  M +2 -2      kicker/ui/k_mnu.cpp   1.117


--- kdebase/kdesktop/krootwm.cc  #1.214:1.215
@@ -790,6 +790,6 @@ void KRootWm::slotPopulateSessions()
 void KRootWm::slotSessionActivated( int ent )
 {
-    if (ent > 0)
-        DM().switchVT( ent );
+    if (ent > 0 && !sessionsMenu->isItemChecked( ent ))
+        DM().lockSwitchVT( ent );
 }
 

--- kdebase/kicker/ui/k_mnu.cpp  #1.116:1.117
@@ -443,6 +443,6 @@ void PanelKMenu::slotSessionActivated( i
     else if (ent == 101)
         doNewSession( false );
-    else
-        DM().switchVT( ent );
+    else if (!sessionsMenu->isItemChecked( ent ))
+        DM().lockSwitchVT( ent );
 }
 

--- kdebase/kdmlib/dmctl.cpp  #1.7:1.8
@@ -23,4 +23,5 @@
 
 #include <klocale.h>
+#include <dcopclient.h>
 
 #include <sys/types.h>
@@ -306,8 +307,15 @@ DM::sess2Str( const SessEnt &se )
 }
 
-void
+bool
 DM::switchVT( int vt )
 {
-        exec( QString("activate\tvt%1\n").arg(vt).latin1() );
+        return exec( QString("activate\tvt%1\n").arg(vt).latin1() );
+}
+
+void
+DM::lockSwitchVT( int vt )
+{
+        if (switchVT( vt ))
+                kapp->dcopClient()->send( "kdesktop", "KScreensaverIface", "lock()", "" );
 }
 

--- kdebase/kdmlib/dmctl.h  #1.5:1.6
@@ -51,5 +51,6 @@ public:
         void startReserve();
         bool localSessions( SessList &list );
-        void switchVT( int vt );
+        bool switchVT( int vt );
+        void lockSwitchVT( int vt );
 
         bool bootOptions( QStringList &opts, int &dflt, int &curr );


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

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