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
Fix an issue where alwaysOnTop window disappears when restore… #9695
Fix an issue where alwaysOnTop window disappears when restore… #9695
Conversation
… the application icon
atom/browser/native_window_mac.mm
Outdated
- (void)windowWillMiniaturize:(NSNotification*)notification { | ||
NSWindow* window = shell_->GetNativeWindow(); | ||
// store the current status window level to be restored in windowDidDeminiaturize | ||
level_ = NSStatusWindowLevel; |
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.
Should this be storing the current level on the window
instead of the hard-coded status window level?
Something like:
level_ = [window level];
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, It should. Fixed it.
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.
Looks good, left a few minor comments, thanks for fixing this.
@@ -75,6 +75,7 @@ @interface AtomNSWindowDelegate : NSObject<NSWindowDelegate> { | |||
@private | |||
atom::NativeWindowMac* shell_; | |||
bool is_zooming_; | |||
int level_; |
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 think this should be initialized in initWithShell
like the other variables.
spec/api-browser-window-spec.js
Outdated
@@ -620,6 +620,22 @@ describe('BrowserWindow module', function () { | |||
}) | |||
}) | |||
|
|||
describe.only('BrowserWindow.alwaysOnTop() resets level on minimize', function () { |
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.
🔥 .only
Thanks for fixing this @shubham2892 👍 🚢 |
Fixes #9170
Reset the custom level when windowWillMiniaturize fires and then restores it when windowDidDeminiaturize fires as suggested in issue.
Before:
After: