homebrew-emacs-plus icon indicating copy to clipboard operation
homebrew-emacs-plus copied to clipboard

Frame refocusing behavior is broken/inconsistent

Open brosasaki opened this issue 1 year ago • 1 comments

emacs-plus@29 installed from Homebrew on MacOS 12.6.8; I use emacs in client/server mode with a script encosed in a dummy app which launches a new client frame.

Currently, the frame refocusing behavior (granted by avoiding the --with-no-refocus option) does not function consistently with other macOS apps.

In Firefox and Finder, "killing a frame" (OS "window") focuses the next frame in the workspace; if there's no frame in the workspace, keyboard focus remains with the "faceless" application*, e.g. if you open and close a lone Finder window and don't select another application, you can press cmd-t to open a new Finder window.

In emacs-plus@29, killing a frame focuses the last-made(?) emacs frame, switching to its workspace if necessary, even if other emacs frames exist on the current workspace. If there are no other emacs frames, focus is sent to the next app in the workspace (I think). This is inconsistent and rarely desired behavior.

*or perhaps the focus is sent to an "out of view" window on another space, if it exists? Pressing cmd-t after closing the only Firefox window in a space switches to the space of another firefox window , if it exists, and opens a new tab, (and cmd-l also switches spaces) but I'm not sure if this behavior is correct or intentional.

brosasaki avatar Nov 26 '23 21:11 brosasaki

+1. I'm seeing the same thing. The refocus behavior is not consistent. Currently I'm still seeing it switch focus back to another Emacs frame on a different desktop. A couple of days ago, it would switch the active app to Emacs but not switch focus to the Emacs frame. Will post more details as I learn more.

ganesh-krishnan avatar Jan 25 '24 19:01 ganesh-krishnan