--- yeahconsole.c.orig 2006-03-11 19:26:00.000000000 +0100 +++ yeahconsole.c 2009-09-19 11:43:07.000000000 +0200 @@ -48,7 +48,7 @@ int revert_to; int screen; int opt_x, opt_width, opt_height, opt_delay, opt_bw, opt_step, - height, opt_restart; + height, opt_restart, opt_restart_hidden; char *opt_color; char *opt_term; KeySym opt_key; @@ -72,7 +72,8 @@ XEvent event; int hidden = 1; int fullscreen = 0; - int i, old_height; + int i; + int old_height = 0; Window last_focused, current_focused; /* strip the path from argv[0] if there is one */ @@ -190,10 +191,18 @@ case UnmapNotify: if (event.xunmap.window == termwin) { if (opt_restart) { + if (opt_restart_hidden) { + roll(UP); + hidden = 1; + } init_xterm(0); XSync(dpy, False); - XSetInputFocus(dpy, termwin, RevertToPointerRoot, - CurrentTime); + if (opt_restart_hidden && last_focused) + XSetInputFocus(dpy, last_focused, + RevertToPointerRoot, CurrentTime); + else + XSetInputFocus(dpy, termwin, RevertToPointerRoot, + CurrentTime); } else { if (last_focused) XSetInputFocus(dpy, last_focused, @@ -264,6 +273,8 @@ opt_step = opt ? atoi(opt) : 1; opt = XGetDefault(dpy, progname, "restart"); opt_restart = opt ? atoi(opt) : 0; + opt = XGetDefault(dpy, progname, "restartHidden"); + opt_restart_hidden = opt ? atoi(opt) : 0; opt = XGetDefault(dpy, progname, "term"); opt_term = opt ? opt : "xterm"; opt = XGetDefault(dpy, progname, "toggleKey");