Browse Source

Fix numlock control (Closes: #12094, #16850, #18522)

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@212 7c53e7cc-98ea-0310-8f1f-a0b24da60408
iwamatsu 9 years ago
parent
commit
427bb5619e
2 changed files with 11 additions and 9 deletions
  1. 9 7
      app.cpp
  2. 2 2
      numlock.cpp

+ 9 - 7
app.cpp

@@ -332,6 +332,15 @@ void App::Run() {
             Login();
         }
     }
+
+    // Set NumLock
+    string numlock = cfg->getOption("numlock");
+    if (numlock == "on") {
+        NumLock::setOn(Dpy);
+    } else if (numlock == "off") {
+        NumLock::setOff(Dpy);
+    }
+    
     // Start looping
     int panelclosed = 1;
     Panel::ActionType Action;
@@ -971,13 +980,6 @@ int App::StartServer() {
         break;
     }
 
-    string numlock = cfg->getOption("numlock");
-    if (numlock == "on") {
-        NumLock::setOn(Dpy);
-    } else if (numlock == "off") {
-        NumLock::setOff(Dpy);
-    }
-    
     delete args;
 
     serverStarted = true;

+ 2 - 2
numlock.cpp

@@ -68,9 +68,9 @@ void NumLock::control_numlock(Display *dpy, bool flag) {
         return;
 
     if( flag == true )
-        XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, 0);
-    else
         XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, mask);
+    else
+        XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, 0);
 }
 
 void NumLock::setOn(Display *dpy) {