-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS] feat: Add "quick-terminal" option to "macos-hidden" config #5803
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5762,6 +5762,7 @@ pub const MacTitlebarProxyIcon = enum { | |
pub const MacHidden = enum { | ||
never, | ||
always, | ||
@"quick-terminal", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh we need to add docs for this to the config key in this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a comment for this new case, but maybe all the related paragraphs above need to be updated as well? |
||
}; | ||
|
||
/// See macos-icon | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I tested the logic of this and imo this callback gets called way too much. On initial launch it's called 4 times and when I close the window once it gets called something like a dozen or more times (I didn't count, but it was a lot).
I think we need to do something different. Maybe "any open window" isn't the right logic and we need to do some more research into how iTerm2 behaves instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's what I noticed as well :/
I saw this method from a blog post about the challenge to track managed windows...
With AppKit Notifications, you get one when a window is about to close, and when one is becoming key/main but that's it.
Maybe we could intercept (via swizzling?) when windows are about to be set to the
NSApp.windows
property; or even add KVO to it (because it is not unfortunately)...Do you think that
applicationDidUpdate(_:)
may cause performance issues?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it'll practically cause issues but I'm afraid it'll cause unnecessary CPU/power usage. I'm not sure how grounded in reality that is but for a feature this minor it doesn't seem worth it.