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

List:       kde-core-devel
Subject:    Patch: add "Lock Screen" key-binding
From:       Helge Deller <deller () gmx ! de>
Date:       2001-05-30 9:45:04
[Download RAW message or body]

Hi,

the following patch adds a global "Lock Screen" key-binding (CTRL-ALT-L) and 
would close bug #24706.
My main concern is, if I break binary compatibility with adding the public 
slot slotLockScreen() to the workspace class. My latest tests didn't showed 
any problems with only kwin and kcontrol/keys/* recompiled, but I may be 
wrong.
Your opinions ?

Greetings,
Helge

["lock_screen.patch" (text/plain)]

Index: kwinbindings.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/kwinbindings.cpp,v
retrieving revision 1.16
diff -u -r1.16 kwinbindings.cpp
--- kwinbindings.cpp	2001/05/22 01:15:09	1.16
+++ kwinbindings.cpp	2001/05/30 09:32:37
@@ -43,6 +43,8 @@
 
  keys->insertItem(i18n("Mouse emulation"),"Mouse emulation", "ALT+F12");
 
+ keys->insertItem(i18n("Lock screen"),"Lock screen", "CTRL+ALT+L");
+ 
  keys->insertItem(i18n("Logout"),"Logout", "CTRL+ALT+Delete");
 
  keys->insertItem(i18n("Kill Window"),"Kill Window", "CTRL+ALT+Escape");
Index: workspace.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/workspace.cpp,v
retrieving revision 1.246
diff -u -r1.246 workspace.cpp
--- workspace.cpp	2001/05/30 05:57:16	1.246
+++ workspace.cpp	2001/05/30 09:32:41
@@ -2425,6 +2425,8 @@
 
     keys->connectItem( "Mouse emulation", this, SLOT( slotMouseEmulation() ) );
 
+    keys->connectItem( "Lock screen", this, SLOT( slotLockScreen() ) );
+
     keys->connectItem( "Logout", this, SLOT( slotLogout() ) );
 
     keys->connectItem( "Kill Window", this, SLOT( slotKillWindow() ) );
@@ -2641,6 +2643,12 @@
         mouse_emulation_state = 0;
         mouse_emulation_window = 0;
     }
+}
+
+void Workspace::slotLockScreen()
+{
+  DCOPClient *client = kapp->dcopClient();
+  client->send("kdesktop", "KScreensaverIface", "lock()", "");
 }
 
 void Workspace::slotLogout()
Index: workspace.h
===================================================================
RCS file: /home/kde/kdebase/kwin/workspace.h,v
retrieving revision 1.85
diff -u -r1.85 workspace.h
--- workspace.h	2001/05/24 21:01:09	1.85
+++ workspace.h	2001/05/30 09:32:41
@@ -264,6 +264,8 @@
     void slotResetAllClientsDelayed();
     void slotResetAllClients();
 
+    void slotLockScreen();
+    
     void slotLogout();
 
     void slotKillWindow();


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

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