Skip to content

fix: enable system maximization for frameless windows except if transparent - #28207

Merged
zcbenz merged 6 commits into
masterfrom
if-maximize-fix
Apr 5, 2021
Merged

zcbenz merged 6 commits into
masterfrom
if-maximize-fix

Conversation

@mlaurencin

@mlaurencin mlaurencin commented Mar 16, 2021 •

Copy link
Copy Markdown
Member

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 recently 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 recently 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 requested review from codebytere and zcbenz March 30, 2021 00:44
@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
Copy Markdown
Contributor

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
Copy Markdown
Member 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

release-clerk Bot commented Apr 5, 2021

Copy link
Copy Markdown

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

trop Bot commented Apr 5, 2021

Copy link
Copy Markdown
Contributor

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

trop Bot commented Apr 12, 2021

Copy link
Copy Markdown
Contributor

@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 <[email protected]>
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.

isMaximized does not reflect OS window state on windows Circular corners in the main window does not work correctly

5 participants