Re: Directional switching

Ian Zimmerman <[email protected]>
Newsgroups gmane.comp.window-managers.openbox
Message-ID <[email protected]>
On 2015-07-07 08:49 -0700, Ian Zimmerman wrote:

> I looked at the code ie. focus_find_directional in openbox/focus_cycle.c
> and I cannot say I understand it.  Is there a paper I can read with a
> rationale?  Or can the author(s) of the code explain?

After more study of the code, leading to some (still imperfect)
understanding what it was trying to do, and some experiments, I came up
with the following simplistic patch.  It seems to DTRT (ie. what I
expect, grin) in all situations I tried.

The 2 and 5 could/should be rc.xml parameters.  With defaults 1 and 1
you'd have the current behavior.  Is there interest in me pursuing that
path and providing a more complete patch?

diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c
index de17650..a58735d 100644
--- a/openbox/focus_cycle.c
+++ b/openbox/focus_cycle.c
@@ -250,7 +250,7 @@ static ObClient *focus_find_directional(ObClient *c,
ObDirection dir,
             continue;
 
         /* Calculate score for this window.  The smaller the better. */
-        score = distance + offset;
+        score = distance * 2 + offset * 5;
 
         /* windows more than 45 degrees off the direction are
          * heavily penalized and will only be chosen if nothing


-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.

_______________________________________________
openbox mailing list
[email protected]
http://icculus.org/mailman/listinfo/openbox
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.