Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix switchws after M-q by trying harder to find a focus window.
[spectrwm.git]
/
scrotwm.c
diff --git
a/scrotwm.c
b/scrotwm.c
index
a3aba41
..
64a8b65
100644
(file)
--- a/
scrotwm.c
+++ b/
scrotwm.c
@@
-198,7
+198,7
@@
GC bar_gc;
XGCValues bar_gcv;
int bar_fidx = 0;
XFontStruct *bar_fs;
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)
char *spawn_term[] = { NULL, NULL }; /* XXX Make fully dynamic */
#define SWM_MENU_FN (2)
@@
-1203,22
+1203,19
@@
switchws(struct swm_region *r, union arg *args)
"%d -> %d\n", r->s->idx, WIDTH(r), HEIGHT(r), X(r), Y(r),
old_ws->idx, wsid);
"%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->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;
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;
/* if the other workspace is hidden, switch windows */
/* map new window first to prevent ugly blinking */
old_ws->r = NULL;
@@
-3191,7
+3188,7
@@
manage_window(Window id)
{
Window trans;
struct workspace *ws;
{
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;
int format, i, ws_idx, n;
unsigned long nitems, bytes;
Atom ws_idx_atom = 0, type;
@@
-3244,8
+3241,17
@@
manage_window(Window id)
errstr, prop);
}
ws = &r->s->ws[ws_idx];
errstr, prop);
}
ws = &r->s->ws[ws_idx];
- } else
+ } else {
ws = r->ws;
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;
/* set up the window layout */
win->id = id;
@@
-3503,6
+3509,9
@@
mappingnotify(XEvent *e)
void
maprequest(XEvent *e)
{
void
maprequest(XEvent *e)
{
+ struct ws_win *win;
+ struct swm_region *r;
+
XMapRequestEvent *ev = &e->xmaprequest;
XWindowAttributes wa;
XMapRequestEvent *ev = &e->xmaprequest;
XWindowAttributes wa;
@@
-3519,9
+3528,10
@@
maprequest(XEvent *e)
stack();
/* make new win focused */
stack();
/* make new win focused */
- struct ws_win *win;
win = find_window(ev->window);
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
}
void
@@
-3898,6
+3908,9
@@
setup_globals(void)
if ((bar_fonts[1] = strdup("-*-times-medium-r-*-*-*-*-*-*-*-*-*-*"))
== NULL)
err(1, "setup_globals: strdup");
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");
}
if ((spawn_term[0] = strdup("xterm")) == NULL)
err(1, "setup_globals: strdup");
}