8000 fix: persist maximizable state through theme change by codebytere · Pull Request #22677 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: persist maximizable state through theme change #22677

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

Merged
merged 1 commit into from
Mar 17, 2020
Merged

Conversation

codebytere
Copy link
Member

Description of Change

(Partially) fixes #22646.

NSWindows reset their traffic light enabled states on redraw, which happens on theme changes (i.e changing from Light to Dark Mode) and so breaks old maximizable settings set by users. Luckily, we already hook into theme changes to reposition traffic lights, so this was a fairly straightforward fix in that we can use that function to persist maximizable state.

cc @MarshallOfSound @zcbenz

Checklist

Release Notes

Notes: Fixed an issue where changing theme on macOS would break window maximizability state.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 13, 2020
Copy link
Member
@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

Will the last line of NativeWindowMac::AddContentViewLayers() cause state shear with maximizable_ having one value and NSWindowZoomButton another value?

      // Some third-party macOS utilities check the zoom button's enabled state to
      // determine whether to show custom UI on hover, so we disable it here to
      // prevent them from doing so in a frameless app window.
      [[window_ standardWindowButton:NSWindowZoomButton] setEnabled:NO];

@codebytere codebytere force-pushed the fix-maximizable branch 2 times, most recently from f9ce28d to f64c453 Compare March 13, 2020 16:58
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 14, 2020
@codebytere codebytere merged commit f4868c9 into master Mar 17, 2020
@release-clerk
Copy link
release-clerk bot commented Mar 17, 2020

Release Notes Persisted

Fixed an issue where changing theme on macOS would break window maximizability state.

@trop
Copy link
Contributor
trop bot commented Mar 17, 2020

I have automatically backported this PR to "9-x-y", please check out #22724

@codebytere codebytere deleted the fix-maximizable branch March 17, 2020 18:05
sentialx pushed a commit to sentialx/electron that referenced this pull request Apr 7, 2020
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.

auto re-enable maximizable even if set to false
3 participants
0