From: Dana Jansens Date: Tue, 16 Apr 2002 07:20:25 +0000 (+0000) Subject: reversed tehmouse wheel buttons on the root window. scrolling up now goes to the... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=113181910a42893edb5e642e37546ab635bcac58;p=chaz%2Fopenbox reversed tehmouse wheel buttons on the root window. scrolling up now goes to the next workspace. --- diff --git a/src/openbox.cc b/src/openbox.cc index 371feb4b..83c3e3d2 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -383,15 +383,16 @@ void Openbox::process_event(XEvent *e) { screen->getRootmenu()->show(); } } else if (e->xbutton.button == 4) { - if ((screen->getCurrentWorkspaceID()-1)<0) - screen->changeWorkspaceID(screen->getWorkspaceCount()-1); + if ((screen->getCurrentWorkspaceID() + 1) > + screen->getWorkspaceCount() - 1) + screen->changeWorkspaceID(0); else - screen->changeWorkspaceID(screen->getCurrentWorkspaceID()-1); + screen->changeWorkspaceID(screen->getCurrentWorkspaceID() + 1); } else if (e->xbutton.button == 5) { - if ((screen->getCurrentWorkspaceID()+1)>screen->getWorkspaceCount()-1) - screen->changeWorkspaceID(0); + if ((screen->getCurrentWorkspaceID() - 1) < 0) + screen->changeWorkspaceID(screen->getWorkspaceCount() - 1); else - screen->changeWorkspaceID(screen->getCurrentWorkspaceID()+1); + screen->changeWorkspaceID(screen->getCurrentWorkspaceID() - 1); } } }