Skip to content
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

Conversation

shubham2892
Copy link
Contributor

Fixes #9170
Reset the custom level when windowWillMiniaturize fires and then restores it when windowDidDeminiaturize fires as suggested in issue.

Before:
Before Gif

After:
After Gif

- (void)windowWillMiniaturize:(NSNotification*)notification {
NSWindow* window = shell_->GetNativeWindow();
// store the current status window level to be restored in windowDidDeminiaturize
level_ = NSStatusWindowLevel;
Copy link
Contributor

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];

Copy link
Contributor Author

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.

Copy link
Contributor

@kevinsawicki kevinsawicki left a 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_;
Copy link
Contributor

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.

@@ -620,6 +620,22 @@ describe('BrowserWindow module', function () {
})
})

describe.only('BrowserWindow.alwaysOnTop() resets level on minimize', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 .only

@kevinsawicki
Copy link
Contributor

Thanks for fixing this @shubham2892 👍 🚢

@kevinsawicki kevinsawicki merged commit 0a71a9b into electron:master Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants