-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
Dusting off a rumps project from a few years ago. I'm now on rumps==0.4.0, pyobjc==12.0, and MacOS 15.7.1 (24G231).
With the upgrades, presenting a Window or alert always results in the window being presented behind my active window. I see the same issue mentioned in #221.
I think the Windowand alert should be presented on top of everything by default. This is my workaround for now:
import rumps
from AppKit import (
NSApplication,
NSApplicationActivationPolicyAccessory,
NSApplicationActivationPolicyRegular,
NSFloatingWindowLevel,
)
class AwesomeStatusBarApp(rumps.App):
@rumps.clicked("Preferences")
def prefs(self, _):
app = NSApplication.sharedApplication()
# Temporarily change to regular app to accept keyboard input
app.setActivationPolicy_(NSApplicationActivationPolicyRegular)
app.activateIgnoringOtherApps_(True)
w = rumps.Window(
title="blah blah blah",
message="typing in here works now",
default_text="",
)
alert_window = w._alert.window()
alert_window.setLevel_(NSFloatingWindowLevel)
alert_window.makeKeyAndOrderFront_(None)
response = w.run()
print(response)
# Change back to accessory app (menu bar only)
app.setActivationPolicy_(NSApplicationActivationPolicyAccessory)
if __name__ == "__main__":
AwesomeStatusBarApp("Awesome App").run()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels