From 4652af7b28167a9d9f00e4cb387af93d9e246d64 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 24 Jul 2002 08:44:21 +0000 Subject: [PATCH] watch for case where not all screens get managed! --- util/epist/epist.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/util/epist/epist.cc b/util/epist/epist.cc index f3084e8c..55e58b58 100644 --- a/util/epist/epist.cc +++ b/util/epist/epist.cc @@ -83,8 +83,8 @@ epist::epist(char **argv, char *dpy_name, char *rc_file) ::exit(1); } - addAction(Action::nextWorkspace, ControlMask, "Tab"); - addAction(Action::prevWorkspace, ControlMask | ShiftMask, "Tab"); + addAction(Action::nextScreen, ControlMask, "Tab"); + addAction(Action::prevScreen, ControlMask | ShiftMask, "Tab"); addAction(Action::nextWindow, Mod1Mask, "Tab"); addAction(Action::prevWindow, Mod1Mask | ShiftMask, "Tab"); addAction(Action::toggleshade, Mod1Mask, "F5"); @@ -204,6 +204,14 @@ XWindow *epist::findWindow(Window window) const { void epist::cycleScreen(int current, bool forward) const { + unsigned int i; + for (i = 0; i < _screens.size(); ++i) + if (_screens[i]->number() == current) { + current = i; + break; + } + assert(i < _screens.size()); // current is for an unmanaged screen + int dest = current + (forward ? 1 : -1); if (dest < 0) dest = (signed)_screens.size() - 1; -- 2.39.2