all repos — fluxbox @ f7c88e4da3b7e8e39711a70fd27d0c464ce1bcde

custom fork of the fluxbox windowmanager

parameter values for next/prev/right/leftWorkspace
fluxgen fluxgen
commit

f7c88e4da3b7e8e39711a70fd27d0c464ce1bcde

parent

18931280a7d4e20cf4a4ec86b2eef18cecc815c4

2 files changed, 16 insertions(+), 22 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.26 2002/02/20 22:40:19 fluxgen Exp $ +// $Id: Screen.cc,v 1.27 2002/02/20 23:04:51 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library

@@ -1712,37 +1712,31 @@

//-------------- nextWorkspace --------------- // Goes to the workspace "right" of the current //-------------------------------------------- -void BScreen::nextWorkspace(void) { - if (getCurrentWorkspaceID()+1 > getCount()-1) - changeWorkspaceID(0); - else - changeWorkspaceID(getCurrentWorkspaceID()+1); +void BScreen::nextWorkspace(const int delta) { + changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount()); } //------------- prevWorkspace ---------------- // Goes to the workspace "left" of the current //-------------------------------------------- -void BScreen::prevWorkspace(void) { - if (getCurrentWorkspaceID()-1 < 0) - changeWorkspaceID(getCount()-1); - else - changeWorkspaceID(getCurrentWorkspaceID()-1); +void BScreen::prevWorkspace(const int delta) { + changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount()); } //-------------- rightWorkspace --------------- // Goes to the workspace "right" of the current //-------------------------------------------- -void BScreen::rightWorkspace(void) { - if (getCurrentWorkspaceID()+1 < getCount()) - changeWorkspaceID(getCurrentWorkspaceID()+1); +void BScreen::rightWorkspace(const int delta) { + if (getCurrentWorkspaceID()+delta < getCount()) + changeWorkspaceID(getCurrentWorkspaceID()+delta); } //------------- leftWorkspace ---------------- // Goes to the workspace "left" of the current //-------------------------------------------- -void BScreen::leftWorkspace(void) { - if (getCurrentWorkspaceID() > 0) - changeWorkspaceID(getCurrentWorkspaceID()-1); +void BScreen::leftWorkspace(const int delta) { + if (getCurrentWorkspaceID() >= delta) + changeWorkspaceID(getCurrentWorkspaceID()-delta); } #ifdef GNOME
M src/Screen.hhsrc/Screen.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.19 2002/02/20 22:41:13 fluxgen Exp $ +// $Id: Screen.hh,v 1.20 2002/02/20 23:04:35 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH

@@ -184,10 +184,10 @@

int addWorkspace(void); int removeLastWorkspace(void); //scroll workspaces - void nextWorkspace(); - void prevWorkspace(); - void rightWorkspace(); - void leftWorkspace(); + void nextWorkspace(const int delta); + void prevWorkspace(const int delta); + void rightWorkspace(const int delta); + void leftWorkspace(const int delta); void removeWorkspaceNames(void); void updateWorkspaceNamesAtom(void);