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

BrowserView: Allow dragging of window to screen above menubar #10661

Merged
merged 2 commits into from Oct 3, 2017

Conversation

Projects
None yet
2 participants
@felixrieseberg
Member

felixrieseberg commented Sep 29, 2017

When implementing the BrowserView drag behavior, I was clever and added logic to prevent the window from being dragged underneath the menubar. Downside: If there's a screen above the menubar, users won't be able to drag the window there.

This code change is only relevant when Electron is built with an SDK < 10.11 (which Electron currently does, sadly). If built with >= 10.11, you'll get native drag behavior. Below, you'll get this fix: It'll check if there's a screen above the menubar, and if so, allow dragging it there.

If you're wondering why all of this is necessary: The BrowserView is above everything else, including all the layers that NSApplication and NSWindow add to our window.

@felixrieseberg felixrieseberg requested a review from poiru Sep 29, 2017

@felixrieseberg felixrieseberg requested a review from electron/browserview as a code owner Sep 29, 2017

@poiru

poiru approved these changes Oct 3, 2017

Thanks for fixing this! I thought I already reviewed this, guess I never submitted it... Sorry for the delay.

@felixrieseberg

This comment has been minimized.

Member

felixrieseberg commented Oct 3, 2017

@poiru No, thank you!

@felixrieseberg felixrieseberg merged commit 4e05d24 into master Oct 3, 2017

8 checks passed

ci/circleci: electron-linux-arm Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-ia32 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-x64 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-mas-x64 Build #5282 succeeded in 13 min
Details
electron-osx-x64 Build #5267 succeeded in 14 min
Details

@felixrieseberg felixrieseberg deleted the browserview-multiple-screens branch Oct 3, 2017

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