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: enable system maximization for frameless windows except if transparent #28207

Merged
merged 6 commits into from Apr 5, 2021

Conversation

mlaurencin
Copy link
Contributor

@mlaurencin mlaurencin commented Mar 16, 2021

Description of Change

Closes #27838
Closes #27264

Previously windows without a frame (including transparent windows) used a workaround in order to maximize properly (See these two PRs: #6417 & #26586). With the latest change however, windows without frames could no longer be properly maximized using the Windows system menu (accessible through alt + space).

With this PR, the ability to maximize and unmaximize using the Windows system menu and double clicking the title bar, has been disabled for transparent windows. These windows will only be maximizable through Electron's API. Non-transparent frameless windows no longer use the workaround and can be maximized using Electron's API or the Windows system menu interchangeably.

Fiddle for testing

Checklist

Release Notes

Notes: Transparent windows cannot be maximized using the Windows system menu or by double clicking the title bar.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Mar 16, 2021
@mlaurencin mlaurencin changed the title fix: move widget maximization check fix: include both system and Electron paths in maximization check Mar 16, 2021
@mlaurencin mlaurencin added the semver/patch backwards-compatible bug fixes label Mar 16, 2021
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 17, 2021
@mlaurencin mlaurencin force-pushed the if-maximize-fix branch 2 times, most recently from 4354914 to c7a7fba Compare March 20, 2021 01:01
@mlaurencin mlaurencin changed the title fix: include both system and Electron paths in maximization check fix: enable system maximization for frameless windows except if transparent Mar 30, 2021
@mlaurencin mlaurencin marked this pull request as ready for review March 30, 2021 19:54
@nornagon
Copy link
Member

Does this break a valid use case where people might want to be able to allow a user to maximize a transparent window with alt+space / titlebar double-click?

@mlaurencin
Copy link
Contributor Author

Does this break a valid use case where people might want to be able to allow a user to maximize a transparent window with alt+space / titlebar double-click?

No, this does not break the use case, but that's because it was not working correctly before either. Unfortunately, both using alt+space and double clicking the title bar cause the system maximization to be called, which breaks the workaround I mentioned in the PR body. I was able to narrow down its usage to only transparent windows (which are a subset), but the limitations still exist. By disabling these cases, these additional limitations are now being made explicit. (I am adding them to the list of transparent window limitations in the documentation with this next commit)

I agree that those are valid use cases though, so disabling these functionalities is just handling the current issues and a new workaround may be good to explore in the future.

@zcbenz zcbenz merged commit 19d7a6b into master Apr 5, 2021
@release-clerk
Copy link

release-clerk bot commented Apr 5, 2021

Release Notes Persisted

Transparent windows cannot be maximized using the Windows system menu or by double clicking the title bar.

@zcbenz zcbenz deleted the if-maximize-fix branch April 5, 2021 23:54
@trop
Copy link
Contributor

trop bot commented Apr 5, 2021

I was unable to backport this PR to "12-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Apr 5, 2021

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

mlaurencin added a commit that referenced this pull request Apr 12, 2021
…parent (#28207)

* fix: move widget maximization check

* fix linting error

* change workaround to only effect transparent windows

* disable menu maximize and restore for transparent windows

* disable double clicking title bar max/unmax for transparent windows

* add docs change and address review
@trop
Copy link
Contributor

trop bot commented Apr 12, 2021

@mlaurencin has manually backported this PR to "12-x-y", please check out #28622

jkleinsc pushed a commit that referenced this pull request Apr 13, 2021
…parent (#28207) (#28622)

* fix: move widget maximization check

* fix linting error

* change workaround to only effect transparent windows

* disable menu maximize and restore for transparent windows

* disable double clicking title bar max/unmax for transparent windows

* add docs change and address review
trop bot pushed a commit that referenced this pull request Apr 13, 2021
…parent (#28207)

* fix: move widget maximization check

* fix linting error

* change workaround to only effect transparent windows

* disable menu maximize and restore for transparent windows

* disable double clicking title bar max/unmax for transparent windows

* add docs change and address review
jkleinsc pushed a commit that referenced this pull request Apr 13, 2021
…parent (#28207) (#28635)

* fix: move widget maximization check

* fix linting error

* change workaround to only effect transparent windows

* disable menu maximize and restore for transparent windows

* disable double clicking title bar max/unmax for transparent windows

* add docs change and address review

Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
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
5 participants