This needs to be extended for all stack swtiches however the others are
being screwed up by autofocus events. Those need to be eaten.
DNPRINTF(SWM_D_EVENT, "vertical_stack: workspace: %d\n", current_ws);
DNPRINTF(SWM_D_EVENT, "vertical_stack: workspace: %d\n", current_ws);
winno = count_win(current_ws, 0);
if (winno == 0)
return;
winno = count_win(current_ws, 0);
if (winno == 0)
return;
if (winno > 1)
gg.w = vertical_msize[current_ws];
if (winno > 1)
gg.w = vertical_msize[current_ws];
DNPRINTF(SWM_D_EVENT, "horizontal_stack: workspace: %d\n", current_ws);
DNPRINTF(SWM_D_EVENT, "horizontal_stack: workspace: %d\n", current_ws);
winno = count_win(current_ws, 0);
if (winno == 0)
return;
winno = count_win(current_ws, 0);
if (winno == 0)
return;
if (winno > 1)
gg.h = horizontal_msize[current_ws];
if (winno > 1)
gg.h = horizontal_msize[current_ws];
XWindowChanges wc;
struct swm_geometry gg = *g;
struct ws_win *win, *winfocus;
XWindowChanges wc;
struct swm_geometry gg = *g;
struct ws_win *win, *winfocus;
- int i, found = 0, winno;
- unsigned int mask;
DNPRINTF(SWM_D_EVENT, "max_stack: workspace: %d\n", current_ws);
DNPRINTF(SWM_D_EVENT, "max_stack: workspace: %d\n", current_ws);
- winno = count_win(current_ws, 0);
- if (winno == 0)
+ if (count_win(current_ws, 0) == 0)
- winfocus = TAILQ_FIRST(&ws[current_ws].winlist);
+ winfocus = ws[current_ws].focus;
+ if (!winfocus)
+ winfocus = TAILQ_FIRST(&ws[current_ws].winlist);
TAILQ_FOREACH (win, &ws[current_ws].winlist, entry) {
if (win->transient != 0 || win->floating != 0) {
TAILQ_FOREACH (win, &ws[current_ws].winlist, entry) {
if (win->transient != 0 || win->floating != 0) {
+ if (win == winfocus)
+ stack_floater(win); /* XXX maximize? */
+ else
+ XUnmapWindow(display, win->id);
} else {
bzero(&wc, sizeof wc);
wc.border_width = 1;
} else {
bzero(&wc, sizeof wc);
wc.border_width = 1;
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
- if (!found) {
- found = 1;
XMapRaised(display, win->id);
XMapRaised(display, win->id);
- } else {
- /* hide all but the master window */
XUnmapWindow(display, win->id);
XUnmapWindow(display, win->id);
- if (win == ws[current_ws].focus)
- winfocus = win;
- else
- unfocus_win(win);
- i++;
}
focus_win(winfocus); /* this has to be done outside of the loop */
}
focus_win(winfocus); /* this has to be done outside of the loop */