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: improve the way frameless windows are handled on Windows #16596

Merged
merged 4 commits into from Jan 31, 2019

Conversation

@brenca
Copy link
Member

commented Jan 29, 2019

Description of Change

Fixes #15816.

Most of the ideas implemented here come from this post, which is mentioned in several comments. Particularly the idea to use insets on the RootView comes from this part:

When the window is maximized, Windows will clip out the border on the app’s behalf if a clipping region hasn’t been applied. In this scenario there’s no reason to have done that, but the thing to watch out for is if glass isn’t extended as deeply into the borders as Windows would have (SM_CXFRAME (+ SM_CXPADDEDBORDER on Vista)) then a maximized window will clip the edges of your client region. The simplest way to work around this is to just place a Border around the window’s content that has a thickness of clipping region, and make its Visibility collapsed when not maximized.

I also took inspiration from this repo, but decided to not mess with undocumented events.

I tested these changes when I put this PR together on Windows 10, 8.1, and 7.

Checklist

Release Notes

Notes:
Improved the way frameless windows are handled on Windows.

@brenca brenca requested review from nitsakh and MarshallOfSound Jan 29, 2019

@brenca brenca requested a review from as a code owner Jan 29, 2019

@zcbenz

zcbenz approved these changes Jan 30, 2019

if (GetNativeWindow() && GetNativeWindow()->GetHost())
return GetNativeWindow()->GetHost()->GetAcceleratedWidget();
else
return nullptr;

This comment has been minimized.

Copy link
@zcbenz

zcbenz Jan 30, 2019

Member

CI failed on Linux with:

../../electron/atom/browser/native_window_views.cc:1103:12: error: cannot initialize return object of type 'gfx::AcceleratedWidget' (aka 'unsigned long') with an rvalue of type 'nullptr_t'
    return nullptr;

brenca added some commits Jan 30, 2019

@brenca brenca force-pushed the brenca/frameless-window-improvements branch from 08e4555 to abff521 Jan 30, 2019

@zcbenz zcbenz merged commit cbb5164 into master Jan 31, 2019

23 of 27 checks passed

appveyor: win-ia32-testing AppVeyor build failed
Details
appveyor: win-x64-testing AppVeyor build failed
Details
electron-arm64-testing Build #20190130.16 has failed
Details
Artifact Comparison
Details
Absolute Zero
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-debug AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-debug AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing-tests Your tests passed on CircleCI!
Details
electron-arm-testing Build #20190130.16 succeeded
Details
electron-lint Build #20190130.14 succeeded
Details
electron-mas-testing Build #20190130.16 succeeded
Details
electron-osx-testing Build #20190130.16 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Jan 31, 2019

Release Notes Persisted

Improved the way frameless windows are handled on Windows.

@zcbenz zcbenz deleted the brenca/frameless-window-improvements branch Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.