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

Refactor NativeWindow (Part 12): Do not use custom content view on macOS #12787

Merged
merged 5 commits into from May 4, 2018

Conversation

Projects
None yet
3 participants
@zcbenz
Contributor

zcbenz commented May 2, 2018

Remove our custom content view on macOS, and rely on views::Widget to provide everything needed for layout.

This PR would allow us to display arbitrary views::View on macOS.

@zcbenz zcbenz requested a review from electron/reviewers as a code owner May 2, 2018

@nornagon

What's the path (if any) to removing all the #if defined(TOOLKIT_VIEWS) scattered around the place?

cl, @selector(setFrameSize:), (IMP)SetFrameSize, "v@:{_NSSize=ff}");
original_view_did_move_to_superview =
class_replaceMethod(cl, @selector(viewDidMoveToSuperview),
(IMP)ViewDidMoveToSuperview, "v@:");

This comment has been minimized.

@nornagon

nornagon May 3, 2018

Contributor

is this sort of messing about with the innards of Cocoa allowed in Mac App Store apps?

@nornagon

nornagon May 3, 2018

Contributor

is this sort of messing about with the innards of Cocoa allowed in Mac App Store apps?

This comment has been minimized.

@zcbenz

zcbenz May 4, 2018

Contributor

There are a few uses of class_addMethod in Chromium, Apple seems to be cool about these uses.

@zcbenz

zcbenz May 4, 2018

Contributor

There are a few uses of class_addMethod in Chromium, Apple seems to be cool about these uses.

@zcbenz

This comment has been minimized.

Show comment
Hide comment
@zcbenz

zcbenz May 4, 2018

Contributor

What's the path (if any) to removing all the #if defined(TOOLKIT_VIEWS) scattered around the place?

I'll probably replace defined(TOOLKIT_VIEWS) with defined(OS_WIN) || defined(OS_LINUX).

Contributor

zcbenz commented May 4, 2018

What's the path (if any) to removing all the #if defined(TOOLKIT_VIEWS) scattered around the place?

I'll probably replace defined(TOOLKIT_VIEWS) with defined(OS_WIN) || defined(OS_LINUX).

zcbenz added some commits May 1, 2018

report correct content size in AtomNSWindow
The views framework relies on NSWindow to return content size of window,
since we don't use the borderless window, the original result would
include titlebar. We have to override the function to return correct
result for frameless window.

@zcbenz zcbenz merged commit 7be30bb into master May 4, 2018

10 checks passed

WIP ready for review
Details
ci/circleci: electron-linux-arm Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64-test 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
ci/circleci: electron-mas-x64 Your tests passed on CircleCI!
Details
ci/circleci: electron-osx-x64 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@zcbenz zcbenz deleted the mac-content-view branch May 4, 2018

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