From 5bb8616d44345e1f1896d94af9ea257439234179 Mon Sep 17 00:00:00 2001 From: Marius Nita Date: Mon, 14 Oct 2002 02:50:44 +0000 Subject: [PATCH] added user option to modify raise behavior when stackedCycling is on --- util/epist/config.cc | 1 + util/epist/config.hh | 1 + util/epist/epistrc.5.in | 11 ++++++++--- util/epist/screen.cc | 11 +++++++---- util/epist/screen.hh | 1 + 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/util/epist/config.cc b/util/epist/config.cc index cefa28cc..461778e5 100644 --- a/util/epist/config.cc +++ b/util/epist/config.cc @@ -97,6 +97,7 @@ void Config::addOption(const std::string &name, const std::string &value) } bool_options[] = { { "stackedcycling", Config::stackedCycling }, + { "stackedcyclingraise", Config::stackedCyclingRaise }, { "", NUM_BOOL_TYPES } }; diff --git a/util/epist/config.hh b/util/epist/config.hh index 2c295747..8749009d 100644 --- a/util/epist/config.hh +++ b/util/epist/config.hh @@ -36,6 +36,7 @@ public: enum BoolType { NO_BOOL_TYPE, stackedCycling, + stackedCyclingRaise, NUM_BOOL_TYPES }; diff --git a/util/epist/epistrc.5.in b/util/epist/epistrc.5.in index a11013b8..06615768 100644 --- a/util/epist/epistrc.5.in +++ b/util/epist/epistrc.5.in @@ -62,18 +62,23 @@ Control-Mod1-x { .br } .SH OPTIONS -.SS stackedCycling (boolean) +.SS stackedCycling (boolean, default=off) When this option is set to True, any window cycling actions, such as nextWindow, prevWindow, nextWindowOfClass, etc., will cause the windows to focus, but they will not be raised until the modifiers are released. When the modifier is released, the focused (and now raised) window will be moved to the top of the stacking order, so if you execute nextWindow and release the modifiers multiple times, focus will cycle between two windows. -.SS chainTimeout (number) +.SS stackedCyclingRaise (boolean, default=off) +This option modifies the window raise behavior when stackedCycling is turned on. +When true, windows will be raised immediatly on focus, rather than when the +keys are released. This may be desirable if you frequently have windows that are +obscured by other windows. +.SS chainTimeout (number, default=3500) Specifies the period of time after which a started key chain will be timed out. It takes a number argument specifying the number of milliseconds to wait. It defaults to 4000. -.SS workspaceColumns (number) +.SS workspaceColumns (number, default=0, disabled) Specifies the number of columns of your workspace layout if you are using your workspaces in a 2-dimensional manner. This option must exist if one of the prevWorkspaceColumn, prevWorkspaceRow, nextWorkspaceColumn, diff --git a/util/epist/screen.cc b/util/epist/screen.cc index 5711d551..ca029652 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -66,7 +66,7 @@ using std::string; screen::screen(epist *epist, int number) : _clients(epist->clientsList()), _active(epist->activeWindow()), _config(epist->getConfig()), _grabbed(true), _cycling(false), - _stacked_cycling(false) + _stacked_cycling(false), _stacked_raise(false) { _epist = epist; _xatom = _epist->xatom(); @@ -76,6 +76,8 @@ screen::screen(epist *epist, int number) _root = _info->getRootWindow(); _config->getValue(Config::stackedCycling, _stacked_cycling); + if (_stacked_cycling) + _config->getValue(Config::stackedCyclingRaise, _stacked_raise); // find a window manager supporting NETWM, waiting for it to load if we must int count = 20; // try for 20 seconds @@ -656,10 +658,11 @@ void screen::cycleWindow(unsigned int state, const bool forward, // if the window is on another desktop, we can't use XSetInputFocus, since // it doesn't imply a workspace change. - if (t->desktop() == _active_desktop || t->desktop() == 0xffffffff) - t->focus(false); // focus, but don't raise + if (_stacked_raise || (t->desktop() != _active_desktop && + t->desktop() != 0xffffffff)) + t->focus(); // raise else - t->focus(); // change workspace and focus + t->focus(false); // don't raise } else { t->focus(); diff --git a/util/epist/screen.hh b/util/epist/screen.hh index 92533d98..f0f3de07 100644 --- a/util/epist/screen.hh +++ b/util/epist/screen.hh @@ -59,6 +59,7 @@ class screen { bool _grabbed; // used for keygrab toggle function bool _cycling; // used for stacked cycling bool _stacked_cycling; + bool _stacked_raise; XWindow *findWindow(const XEvent &e) const; void updateNumDesktops(); -- 2.45.2