JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fix bug where a transient destroy would not give back the focus to the
authorMarco Peereboom <marco@conformal.com>
Thu, 1 Oct 2009 21:27:19 +0000 (21:27 +0000)
committerMarco Peereboom <marco@conformal.com>
Thu, 1 Oct 2009 21:27:19 +0000 (21:27 +0000)
parent when the mouse was over the transient window.

scrotwm.c

index 6964df7..d31cde5 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -3494,7 +3494,11 @@ destroynotify(XEvent *e)
                /* find a window to focus */
                ws = win->ws;
                wl = &ws->winlist;
-               if (ws->focus == win) {
+
+               /* if we are transient give focus to parent */
+               if (win->transient)
+                       winfocus = find_window(win->transient);
+               else if (ws->focus == win) {
                        if (TAILQ_FIRST(wl) == win)
                                winfocus = TAILQ_NEXT(win, entry);
                        else {