added user option to modify raise behavior when stackedCycling is on
authorMarius Nita <marius@cs.pdx.edu>
Mon, 14 Oct 2002 02:50:44 +0000 (02:50 +0000)
committerMarius Nita <marius@cs.pdx.edu>
Mon, 14 Oct 2002 02:50:44 +0000 (02:50 +0000)
util/epist/config.cc
util/epist/config.hh
util/epist/epistrc.5.in
util/epist/screen.cc
util/epist/screen.hh

index cefa28c..461778e 100644 (file)
@@ -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 }
   };
 
index 2c29574..8749009 100644 (file)
@@ -36,6 +36,7 @@ public:
   enum BoolType {
     NO_BOOL_TYPE,
     stackedCycling,
+    stackedCyclingRaise,
     NUM_BOOL_TYPES
   };
 
index a11013b..0661576 100644 (file)
@@ -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,
index 5711d55..ca02965 100644 (file)
@@ -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();
index 92533d9..f0f3de0 100644 (file)
@@ -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();