From 1e10da5da6a38f589c9d3a83f88724fc72d8bbbc Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Thu, 14 Oct 2010 17:40:52 +0000 Subject: [PATCH] Fix keyboard not getting focus after quitting gimp. from Henri Kemppainen --- scrotwm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scrotwm.c b/scrotwm.c index b7f37fd..1a4dedb 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -4439,9 +4439,15 @@ unmanage_window(struct ws_win *win) parent->child_trans = NULL; } - /* work around for mplayer going full screen */ - if (!win->floating) - focus_prev(win); + if (count_win(win->ws, 0) > 1) { + /* work around for mplayer going full screen */ + if (!win->floating) + focus_prev(win); + } else + /* the last window is getting nuked, so make sure + the keyboard isn't left without focus */ + XSetInputFocus(display, PointerRoot, + PointerRoot, CurrentTime); TAILQ_REMOVE(&win->ws->winlist, win, entry); TAILQ_INSERT_TAIL(&win->ws->unmanagedlist, win, entry); -- 1.7.10.4