allow SPOT1 on right #1
This commit is contained in:
7
config.h
7
config.h
@@ -18,6 +18,13 @@
|
|||||||
// | | 3 |
|
// | | 3 |
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
|
||||||
|
// Actually, there are a few layout choices, but only at build time.
|
||||||
|
|
||||||
|
// The layout can be flipped so SPOT1 is on the right.
|
||||||
|
// If you do this, review the directional move/focus key bindings too.
|
||||||
|
//#define SPOT1_ALIGN SPOT1_RIGHT
|
||||||
|
#define SPOT1_ALIGN SPOT1_LEFT
|
||||||
|
|
||||||
// Width of SPOT1 as percentage of screen width.
|
// Width of SPOT1 as percentage of screen width.
|
||||||
#define SPOT1_WIDTH_PCT 67
|
#define SPOT1_WIDTH_PCT 67
|
||||||
|
|
||||||
|
|||||||
9
xoat.c
9
xoat.c
@@ -362,18 +362,17 @@ void spot_calc_xywh(int spot, int mon, int *x, int *y, int *w, int *h)
|
|||||||
monitor *m = &monitors[MIN(nmonitors-1, MAX(0, mon))];
|
monitor *m = &monitors[MIN(nmonitors-1, MAX(0, mon))];
|
||||||
int width_spot1 = (double)m->w / 100 * MIN(90, MAX(10, SPOT1_WIDTH_PCT));
|
int width_spot1 = (double)m->w / 100 * MIN(90, MAX(10, SPOT1_WIDTH_PCT));
|
||||||
int height_spot2 = (double)m->h / 100 * MIN(90, MAX(10, SPOT2_HEIGHT_PCT));
|
int height_spot2 = (double)m->h / 100 * MIN(90, MAX(10, SPOT2_HEIGHT_PCT));
|
||||||
|
int x_spot1 = SPOT1_ALIGN == SPOT1_LEFT ? m->x: m->x + m->w - width_spot1;
|
||||||
|
int x_spot2 = SPOT1_ALIGN == SPOT1_LEFT ? m->x + width_spot1: m->x;
|
||||||
|
|
||||||
// default, left 2/3 of screen
|
*x = x_spot1, *y = m->y, *w = width_spot1, *h = m->h;
|
||||||
*x = m->x, *y = m->y, *w = width_spot1, *h = m->h;
|
|
||||||
if (spot == SPOT1) return;
|
if (spot == SPOT1) return;
|
||||||
|
|
||||||
// right top 2/9 of screen
|
*x = x_spot2;
|
||||||
*x = m->x + width_spot1;
|
|
||||||
*w = m->w - width_spot1;
|
*w = m->w - width_spot1;
|
||||||
*h = height_spot2;
|
*h = height_spot2;
|
||||||
if (spot == SPOT2) return;
|
if (spot == SPOT2) return;
|
||||||
|
|
||||||
// right bottom 1/9 of screen
|
|
||||||
*y = m->y + height_spot2;
|
*y = m->y + height_spot2;
|
||||||
*h = m->h - height_spot2;
|
*h = m->h - height_spot2;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user