From a6fd205bc1bff56edbdde753498b115bb31e3549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 20 Mar 2024 16:59:46 +0100 Subject: [PATCH] Raise newly focused window when current one closes The current behavior is confusing. All windows are maximized. Open Emacs, Alt-tab over all windows back to Emacs. Close Emacs. The chosen window to have focus (because Emacs window is gone) is _not_ the one on top [1]. So you don't really see what window is being focused (remember all windows are maximized). Whatever you type is going to a window you cannot see. The behavior is different if you don't just cycle through all windows. [1] because it's chosen from MRU list, but I'm not exactly sure how MRU list is updated, when alt-tabbing. So perhaps the problem is with updating MRU correctly. --- src/Workspaces.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Workspaces.cc b/src/Workspaces.cc index 4eefeeb0..1aacdd81 100644 --- a/src/Workspaces.cc +++ b/src/Workspaces.cc @@ -974,6 +974,7 @@ Workspaces::findWOAndFocus(PWinObj *search) if (focus) { focus->giveInputFocus(); + focus->raise(); } else if (! PWinObj::getFocusedPWinObj()) { pekwm::rootWo()->giveInputFocus(); pekwm::rootWo()->setEwmhActiveWindow(None);