small window cycling bugs
This commit is contained in:
14
action.c
14
action.c
@@ -57,13 +57,15 @@ void action_close(void *data, int num, client *cli)
|
||||
void action_cycle(void *data, int num, client *cli)
|
||||
{
|
||||
if (!cli) return;
|
||||
STACK_INIT(lower);
|
||||
if (spot_count_windows(cli->spot, cli->monitor) > 1)
|
||||
STACK_INIT(order);
|
||||
if (spot_stack_clients(cli->spot, cli->monitor, &order) > 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);
|
||||
int i; client *c = NULL;
|
||||
for_stack(&order, i, c) if (c->manage && c->transient == None && c->window != cli->window)
|
||||
{
|
||||
client_activate(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
8
spot.c
8
spot.c
@@ -137,4 +137,12 @@ 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;
|
||||
}
|
||||
|
||||
int spot_stack_clients(int spot, int mon, stack *stk)
|
||||
{
|
||||
int i; client *c;
|
||||
for_windows(i, c) if (c->manage && c->spot == spot && c->monitor == mon)
|
||||
client_stack_family(c, stk);
|
||||
return stk->depth;
|
||||
}
|
||||
8
xoat.c
8
xoat.c
@@ -127,6 +127,14 @@ void action_maximize(void*, int, client*);
|
||||
#define STACK_INIT(n) stack (n); memset(&(n), 0, sizeof(stack))
|
||||
#define STACK_FREE(s) while ((s)->depth) client_free((s)->clients[--(s)->depth])
|
||||
|
||||
#define for_stack(s,i,c)\
|
||||
for ((i) = 0; (i) < (s)->depth; (i)++)\
|
||||
if (((c) = (s)->clients[(i)]))
|
||||
|
||||
#define for_stack_rev(s,i,c)\
|
||||
for ((i) = (s)->depth-1; (i) > -1; (i)--)\
|
||||
if (((c) = (s)->clients[(i)]))
|
||||
|
||||
#define for_windows(i,c)\
|
||||
for (query_windows(), (i) = 0; (i) < windows.depth; (i)++)\
|
||||
if (((c) = windows.clients[(i)]))
|
||||
|
||||
Reference in New Issue
Block a user