Skip to content

Instantly share code, notes, and snippets.

@connordavenport
Created April 29, 2020 17:49
Show Gist options
  • Save connordavenport/f0fad8ed6ec0d497c5bb19688b2f0e73 to your computer and use it in GitHub Desktop.
Save connordavenport/f0fad8ed6ec0d497c5bb19688b2f0e73 to your computer and use it in GitHub Desktop.
Bring RF extension windows to the front when app becomes active
from AppKit import *
from mojo.events import addObserver
class frontAndCenter():
def __init__(self):
addObserver(self,"bringFront", "applicationDidBecomeActive")
def bringFront(self,sender):
windows = [w for w in NSApp().orderedWindows() if w.isVisible()]
for win in windows:
if not hasattr(win,"windowName"):
win.makeKeyAndOrderFront_(win)
frontAndCenter()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment