support spot layouts and proportions per-monitor

This commit is contained in:
Sean Pringle
2013-06-08 23:55:26 +10:00
parent dcfb8f0847
commit 0de1e0a6d2
5 changed files with 53 additions and 39 deletions

10
spot.c
View File

@@ -115,18 +115,20 @@ Window spot_try_focus_top_window(int spot, int mon, Window except)
int spot_choose_by_direction(int spot, int mon, int dir)
{
monitor *m = &monitors[mon];
int spot1_align = have_layout(mon) ? layouts[mon].spot1_align : LEFT ;
if (m->w < m->h) // rotated?
{
if (dir == LEFT) return SPOT3;
if (dir == RIGHT) return SPOT2;
if (dir == UP) return SPOT1_ALIGN == SPOT1_LEFT ? SPOT1: SPOT2;
if (dir == DOWN) return SPOT1_ALIGN == SPOT1_LEFT ? SPOT2: SPOT1;
if (dir == UP) return spot1_align == LEFT ? SPOT1: SPOT2;
if (dir == DOWN) return spot1_align == LEFT ? SPOT2: SPOT1;
return spot;
}
if (dir == UP) return SPOT2;
if (dir == DOWN) return SPOT3;
if (dir == LEFT) return SPOT1_ALIGN == SPOT1_LEFT ? SPOT1: SPOT2;
if (dir == RIGHT) return SPOT1_ALIGN == SPOT1_LEFT ? SPOT2: SPOT1;
if (dir == LEFT) return spot1_align == LEFT ? SPOT1: SPOT2;
if (dir == RIGHT) return spot1_align == LEFT ? SPOT2: SPOT1;
return spot;
}