restart_hidden.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --- yeahconsole.c.orig 2006-03-11 19:26:00.000000000 +0100
  2. +++ yeahconsole.c 2009-09-19 11:43:07.000000000 +0200
  3. @@ -48,7 +48,7 @@
  4. int revert_to;
  5. int screen;
  6. int opt_x, opt_width, opt_height, opt_delay, opt_bw, opt_step,
  7. - height, opt_restart;
  8. + height, opt_restart, opt_restart_hidden;
  9. char *opt_color;
  10. char *opt_term;
  11. KeySym opt_key;
  12. @@ -72,7 +72,8 @@
  13. XEvent event;
  14. int hidden = 1;
  15. int fullscreen = 0;
  16. - int i, old_height;
  17. + int i;
  18. + int old_height = 0;
  19. Window last_focused, current_focused;
  20. /* strip the path from argv[0] if there is one */
  21. @@ -190,10 +191,18 @@
  22. case UnmapNotify:
  23. if (event.xunmap.window == termwin) {
  24. if (opt_restart) {
  25. + if (opt_restart_hidden) {
  26. + roll(UP);
  27. + hidden = 1;
  28. + }
  29. init_xterm(0);
  30. XSync(dpy, False);
  31. - XSetInputFocus(dpy, termwin, RevertToPointerRoot,
  32. - CurrentTime);
  33. + if (opt_restart_hidden && last_focused)
  34. + XSetInputFocus(dpy, last_focused,
  35. + RevertToPointerRoot, CurrentTime);
  36. + else
  37. + XSetInputFocus(dpy, termwin, RevertToPointerRoot,
  38. + CurrentTime);
  39. } else {
  40. if (last_focused)
  41. XSetInputFocus(dpy, last_focused,
  42. @@ -264,6 +273,8 @@
  43. opt_step = opt ? atoi(opt) : 1;
  44. opt = XGetDefault(dpy, progname, "restart");
  45. opt_restart = opt ? atoi(opt) : 0;
  46. + opt = XGetDefault(dpy, progname, "restartHidden");
  47. + opt_restart_hidden = opt ? atoi(opt) : 0;
  48. opt = XGetDefault(dpy, progname, "term");
  49. opt_term = opt ? opt : "xterm";
  50. opt = XGetDefault(dpy, progname, "toggleKey");