-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Fixed cocoa window content visibilty in app full screen #2800
Changes from 3 commits
a2e21fb
5d92f36
b03ba93
88f70a8
5d474a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The children of a window with a ``toga.Box()`` as its content are now visible in app full-screen mode. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,11 @@ def __init__(self, interface, title, position, size): | |
self.container = Container(on_refresh=self.content_refreshed) | ||
self.native.contentView = self.container.native | ||
|
||
# In app full-screen mode, window._impl.native.contentView is moved to a | ||
# _NSFullScreenWindow, making NSWindow.contentView as None. Hence, retain a | ||
# reference to the view before going full-screen. | ||
self.content_view = self.native.contentView | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Full explaination comment that I had previously written, but felt too big to include in the source file: Once we go fullscreen on Hence, we can no longer accesss the view by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may not be able to reference |
||
|
||
# Ensure that the container renders it's background in the same color as the window. | ||
self.native.wantsLayer = True | ||
self.container.native.backgroundColor = self.native.backgroundColor | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a bonus effect of using
window._impl.native.contentView
, we can lift the requirement of needing a content to be assigned to a window in cocoa, for entering into PRESENTATION mode in #2473