XGCValues bar_gcv;
int bar_fidx = 0;
XFontStruct *bar_fs;
-char *bar_fonts[] = { NULL, NULL, NULL }; /* XXX Make fully dynamic */
+char *bar_fonts[] = { NULL, NULL, NULL, NULL };/* XXX Make fully dynamic */
char *spawn_term[] = { NULL, NULL }; /* XXX Make fully dynamic */
#define SWM_MENU_FN (2)
"%d -> %d\n", r->s->idx, WIDTH(r), HEIGHT(r), X(r), Y(r),
old_ws->idx, wsid);
- /* get focus window */
- if (new_ws->focus)
- winfocus = new_ws->focus;
- else if (new_ws->focus_prev)
- winfocus = new_ws->focus_prev;
+ if (new_ws == old_ws)
+ return;
+ /* get focus window */
if (new_ws->focus)
winfocus = new_ws->focus;
else if (new_ws->focus_prev)
winfocus = new_ws->focus_prev;
-
- if (new_ws == old_ws)
- return;
+ else
+ winfocus = TAILQ_FIRST(&new_ws->winlist);
other_r = new_ws->r;
- if (!other_r) {
+ if (other_r == NULL) {
/* if the other workspace is hidden, switch windows */
/* map new window first to prevent ugly blinking */
old_ws->r = NULL;
{
Window trans;
struct workspace *ws;
- struct ws_win *win;
+ struct ws_win *win, *ww;
int format, i, ws_idx, n;
unsigned long nitems, bytes;
Atom ws_idx_atom = 0, type;
errstr, prop);
}
ws = &r->s->ws[ws_idx];
- } else
+ } else {
ws = r->ws;
+ /* this should launch transients in the same ws as parent */
+ /* XXX doesn't work for intel xrandr */
+ if (id && trans) {
+ if ((ww = find_window(trans)) != NULL) {
+ ws = ww->ws;
+ r = ws->r;
+ }
+ }
+ }
/* set up the window layout */
win->id = id;
void
maprequest(XEvent *e)
{
+ struct ws_win *win;
+ struct swm_region *r;
+
XMapRequestEvent *ev = &e->xmaprequest;
XWindowAttributes wa;
stack();
/* make new win focused */
- struct ws_win *win;
win = find_window(ev->window);
- focus_win(win);
+ r = root_to_region(win->wa.root);
+ if (win->ws == r->ws) /* XXX this probably breaks multi screen */
+ focus_win(win);
}
void
if ((bar_fonts[1] = strdup("-*-times-medium-r-*-*-*-*-*-*-*-*-*-*"))
== NULL)
err(1, "setup_globals: strdup");
+ if ((bar_fonts[2] = strdup("-misc-fixed-medium-r-*-*-*-*-*-*-*-*-*-*"))
+ == NULL)
+ err(1, "setup_globals: strdup");
if ((spawn_term[0] = strdup("xterm")) == NULL)
err(1, "setup_globals: strdup");
}