Improve window cycling behavior when maxv/maxh/max windows overlap.

This commit is contained in:
Sean Pringle
2014-09-11 16:32:26 +10:00
parent a803468635
commit 1778b9d413
2 changed files with 13 additions and 4 deletions

View File

@@ -58,10 +58,13 @@ void action_cycle(void *data, int num, client *cli)
{
if (!cli) return;
STACK_INIT(lower);
spot_focus_top_window(cli->spot, cli->monitor, cli->window);
client_stack_family(cli, &lower);
XLowerWindow(display, lower.windows[0]);
XRestackWindows(display, lower.windows, lower.depth);
if (spot_count_windows(cli->spot, cli->monitor) > 1)
{
spot_focus_top_window(cli->spot, cli->monitor, cli->window);
client_stack_family(cli, &lower);
XLowerWindow(display, lower.windows[0]);
XRestackWindows(display, lower.windows, lower.depth);
}
}
void action_raise_nth(void *data, int num, client *cli)

6
spot.c
View File

@@ -132,3 +132,9 @@ int spot_choose_by_direction(int spot, int mon, int dir)
return spot;
}
int spot_count_windows(int spot, int mon)
{
int i, n = 0; client *c;
for_windows(i, c) if (c->manage && c->spot == spot && c->monitor == mon) n++;
return n;
}