From 0c2fc0568b5b8a90fdfec4949c0d4df81bcaacbf Mon Sep 17 00:00:00 2001 From: pekdon Date: Sat, 2 Feb 2002 19:51:15 +0000 Subject: leftWorkspace/rightWorkspace added --- ChangeLog | 5 +++++ src/Screen.cc | 16 ++++++++++++++++ src/Screen.hh | 4 +++- src/fluxbox.cc | 13 +++++-------- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25b61fb..9aa8b16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ Changes for 0.1.7: +*02/02/02: + * Added leftWorkspace and rightWorkspace, now those keybindings + actually work. (Claes Nästén) + * Fixed small glitch in Tab.cc. (Claes Nästén) + *02/01/27: * Clean up in menu loading * Moved from old C style file reading to c++ istream diff --git a/src/Screen.cc b/src/Screen.cc index e0358fc..5d20aff 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1643,3 +1643,19 @@ void BScreen::prevWorkspace(void) { else changeWorkspaceID(getCurrentWorkspaceID()-1); } + +//-------------- rightWorkspace --------------- +// Goes to the workspace "right" of the current +//-------------------------------------------- +void BScreen::rightWorkspace(void) { + if (getCurrentWorkspaceID()+1 < getCount()) + changeWorkspaceID(getCurrentWorkspaceID()+1); +} + +//------------- leftWorkspace ---------------- +// Goes to the workspace "left" of the current +//-------------------------------------------- +void BScreen::leftWorkspace(void) { + if (getCurrentWorkspaceID() > 0) + changeWorkspaceID(getCurrentWorkspaceID()-1); +} diff --git a/src/Screen.hh b/src/Screen.hh index c91a45c..6e020b4 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.13 2002/01/27 12:45:32 fluxgen Exp $ +// $Id: Screen.hh,v 1.14 2002/02/02 19:51:15 pekdon Exp $ #ifndef _SCREEN_HH_ #define _SCREEN_HH_ @@ -205,6 +205,8 @@ public: //scroll workspaces void nextWorkspace(); void prevWorkspace(); + void rightWorkspace(); + void leftWorkspace(); void removeWorkspaceNames(void); void updateWorkspaceNamesAtom(void); diff --git a/src/fluxbox.cc b/src/fluxbox.cc index e859921..a45f4e4 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.24 2002/01/21 02:04:23 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.25 2002/02/02 19:51:15 pekdon Exp $ //Use some GNU extensions #ifndef _GNU_SOURCE @@ -958,15 +958,12 @@ void Fluxbox::process_event(XEvent *e) { case Keys::PREVWORKSPACE: screen->prevWorkspace(); break; - /*case Keys::grabUpWorkspace: + case Keys::LEFTWORKSPACE: + screen->leftWorkspace(); break; - case Keys::grabDownWorkspace: + case Keys::RIGHTWORKSPACE: + screen->rightWorkspace(); break; - case Keys::grabLeftWorkspace: - break; - case Keys::grabRightWorkspace: - break; - */ case Keys::KILLWINDOW: //kill the current window XKillClient(screen->getBaseDisplay()->getXDisplay(), focused_window->getClientWindow()); -- cgit v0.11.2