From 85cb80b39a1f4af8aa5c3c8feb2a8831bd0ea977 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Wed, 30 Sep 2009 04:21:49 +0000 Subject: [PATCH] Add an extra font that more people likely have. From Juergen Daubert Add a "lose focus after ws fix" for slow launching apps such as gimp. This will likely break xrandr multi screen but that is a fix for later. --- scrotwm.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scrotwm.c b/scrotwm.c index 0dda010..716759d 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -198,7 +198,7 @@ GC bar_gc; 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) @@ -3512,6 +3512,9 @@ mappingnotify(XEvent *e) void maprequest(XEvent *e) { + struct ws_win *win; + struct swm_region *r; + XMapRequestEvent *ev = &e->xmaprequest; XWindowAttributes wa; @@ -3528,9 +3531,10 @@ maprequest(XEvent *e) 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 @@ -3907,6 +3911,9 @@ setup_globals(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"); } -- 1.7.10.4