Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua

Home Page:http://www.hammerspoon.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hs.window:raise() focuses raised window when other window for same application is focused

mogenson opened this issue · comments

Hello, as described in the documentation [hs.window:raise()](https://www.hammerspoon.org/docs/hs.window.html#raise), "Brings a window to the front of the screen without focussing it".

Unless another window for the same application is focused. Then focus will shift to the raised window.

Example:

  1. window1 is a Finder window and window2 is a Finder window.
  2. Focus window1
  3. window2:raise()
  4. Focus has shifted to window2.

Are there any workarounds for this behavior?

I guess you can write a wrapper function. If the current app is the same as the window you want to raise, save the window, raise the other window, select previous window.