Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better, hopefully math-exception-free logic for multi-column stacker, and
[spectrwm.git]
/
scrotwm.c
diff --git
a/scrotwm.c
b/scrotwm.c
index
6f891fe
..
3fb090f
100644
(file)
--- a/
scrotwm.c
+++ b/
scrotwm.c
@@
-1390,9
+1390,9
@@
stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip)
continue;
if (split && i == split) {
continue;
if (split && i == split) {
- colno = (winno - split) / s;
- if (stacks == 1)
- colno += (winno - split) % s;
+ colno = (winno - mwin) / stacks;
+ if (s <= (winno - mwin) % stacks)
+ colno++;
split = split + colno;
hrh = (r_g.h / colno);
extra = r_g.h - (colno * hrh);
split = split + colno;
hrh = (r_g.h / colno);
extra = r_g.h - (colno * hrh);
@@
-1400,7
+1400,11
@@
stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip)
win_g.x = r_g.x;
else
win_g.x += win_g.w + 2;
win_g.x = r_g.x;
else
win_g.x += win_g.w + 2;
- win_g.w = (r_g.w - (msize + 2) - (stacks * 2)) / stacks;
+ win_g.w = (((r_g.w - (msize + 2)) -
+ ((stacks - 1) * 2)) / stacks);
+ if (s == 1)
+ win_g.w += (((r_g.w - (msize + 2)) -
+ ((stacks - 1) * 2)) % stacks);
s--;
j = 0;
}
s--;
j = 0;
}