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: use setAspectRatio for frameless window on mac #32287

Merged

Conversation

gerhardberger
Copy link
Contributor

Description of Change

On macOS, NSWindow.setContentAspectRatio was being used to set the aspect ratio. However this works incorrectly for frameless windows, causing a jump in window size, when starting the resize. But using NSWindow.setAspectRatio, it works correctly for frameless windows (but not for framed windows, so we still have to use setContentAspectRatio in that case.)

Before:

Screen.Recording.2021-12-26.at.16.18.56.mov

After:

Screen.Recording.2021-12-26.at.16.18.11.mov

Checklist

Release Notes

Notes: Fixes aspect ratio resize for frameless windows on macOS.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Dec 26, 2021
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 2, 2022
@codebytere codebytere changed the title fix: uses setAspectRatio for frameless window on mac fix: use setAspectRatio for frameless window on mac Jan 3, 2022
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/15-x-y labels Jan 3, 2022
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.

Looks like this is just waiting for a report back from a lintbot that got lost.

@gerhardberger could you push a merge that updates from main just to kick off the bots again?

@zcbenz zcbenz changed the title fix: use setAspectRatio for frameless window on mac fix: use setAspectRatio for frameless window on mac FIX CI Jan 13, 2022
@zcbenz zcbenz changed the title fix: use setAspectRatio for frameless window on mac FIX CI fix: use setAspectRatio for frameless window on mac Jan 13, 2022
@zcbenz zcbenz merged commit f454898 into electron:main Jan 13, 2022
@release-clerk
Copy link

release-clerk bot commented Jan 13, 2022

Release Notes Persisted

Fixes aspect ratio resize for frameless windows on macOS.

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

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

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

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

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

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

t57ser pushed a commit to t57ser/electron that referenced this pull request Jan 25, 2022
* fix(window): setAspectRatio for frameless windows

* dummy

* undo dummy

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants