Skip to content

Commit

Permalink
Fix numlock control (Closes: #12094, #16850, #18522)
Browse files Browse the repository at this point in the history
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
  • Loading branch information
iwamatsu committed Apr 16, 2012
1 parent f766d18 commit e9aedf4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions numlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e9aedf4

Please sign in to comment.