Skip to content

fix: Frameless window shows frame while opening - #35189

Merged
MarshallOfSound merged 4 commits into
electron:mainfrom
rzhao271:rzhao271/frameless-window
Aug 16, 2022
Merged

MarshallOfSound merged 4 commits into
electron:mainfrom
rzhao271:rzhao271/frameless-window

Conversation

@rzhao271

@rzhao271 rzhao271 commented Aug 2, 2022 •

Copy link
Copy Markdown
Contributor

Description of Change

Fixes #30760

The frame was showing because #29594 removed the CanResize accessor on the Electron side, which made it so that WidgetDelegate::CanResize started initially returning false. I have to do more investigation to see why CanResize returning false early on leads to the frame showing up. I have confirmed that the issue doesn't have to do with SetCanResize making the widget emit OnSizeConstraintsChanged.

Note that this PR only fixes the issue frameless windows that are resizable. It does not fix the issue for frameless windows that are not resizable (see #30024 (comment)).

CC @deepak1556

Checklist

Release Notes

Notes: Fixed an issue where frameless resizable windows showed Window 7 style frames while opening.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 2, 2022
@rzhao271
rzhao271 force-pushed the rzhao271/frameless-window branch 2 times, most recently from b28d0ea to 3c20e29 Compare August 3, 2022 16:26
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 9, 2022
@rzhao271
rzhao271 marked this pull request as ready for review August 11, 2022 18:17
@rzhao271
rzhao271 requested review from a team as code owners August 11, 2022 18:17
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 11, 2022

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For context on this change please read up microsoft/vscode#146683 (comment)

What we are doing in this PR is restoring the behavior of framless resizable windows to have the same styles as before 172ac25 . Basically the presence of WS_THICKFRAME before the widget creation has an impact on the NC messages received and hiding the resizable frame. We still don't know why this happens and we are following up with DWM team on windows to understand better so that we can also fix this for the non-resizable frameless scenario #30024.

Comment thread shell/browser/native_window_views.cc Resolved
@rzhao271
rzhao271 requested a review from deepak1556 August 12, 2022 21:11
@zcbenz zcbenz added semver/patch backwards-compatible bug fixes target/19-x-y target/21-x-y PR should also be added to the "21-x-y" branch. labels Aug 15, 2022
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 15, 2022
Comment thread shell/browser/native_window_views.cc Resolved
@rzhao271
rzhao271 force-pushed the rzhao271/frameless-window branch from e416ee1 to 5eee138 Compare August 15, 2022 16:53
@rzhao271
rzhao271 force-pushed the rzhao271/frameless-window branch from 5eee138 to 1c0f118 Compare August 15, 2022 16:54
@MarshallOfSound
MarshallOfSound merged commit 947f1b0 into electron:main Aug 16, 2022
@release-clerk

release-clerk Bot commented Aug 16, 2022

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where frameless resizable windows showed Window 7 style frames while opening.

@trop

trop Bot commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/20-x-y and removed target/20-x-y target/21-x-y PR should also be added to the "21-x-y" branch. labels Aug 16, 2022
@rzhao271
rzhao271 deleted the rzhao271/frameless-window branch August 16, 2022 21:43
@trop trop Bot added merged/20-x-y merged/21-x-y PR was merged to the "21-x-y" branch. and removed in-flight/20-x-y labels Aug 17, 2022
@miniak

miniak commented Aug 28, 2022

Copy link
Copy Markdown
Contributor

/trop run backport-to 18-x-y

@trop

trop Bot commented Aug 28, 2022

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated - sending your PR to 18-x-y!

@trop

trop Bot commented Aug 28, 2022

Copy link
Copy Markdown
Contributor

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

schetle pushed a commit to schetle/electron that referenced this pull request Nov 3, 2022
* fix: Frameless window shows frame while opening

* Clarify comments

* Inline setter

* Edit comment
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
* fix: Frameless window shows frame while opening

* Clarify comments

* Inline setter

* Edit comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/21-x-y PR was merged to the "21-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Frameless window displays frame while opening

5 participants