Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using
NSFullSizeContentViewWindowMask
to get borderless windows,
because that disables the swap interval. This hack is very simple but a little evil. We get the superview of the content view, which is the `NSThemeFrame`, and install an OpenGL context into it. `NSThemeFrame` is a private class, but we only call public `NSView` APIs on it here, so this seems OK in terms of being supported by Apple going forward. The reason for using this hack as opposed to `NSFullSizeContentViewWindowMask` is that the latter forces the window to be Core Animation-backed, which results in us rendering to an off screen surface. Not only does this inject another compositor into the system, but it also results in us rendering to an off-screen surface, disabling the swap interval. This depends on a `cocoa-rs` upgrade to add a binding to the `-[NSView superview]` method. Known issues: * The traffic light buttons are not drawn but still function if you click on them. This can be worked around in browser.html. * The top border is not rounded, although the shadow properly displays. This should be able to be worked around in browser.html. * The title bar reappears if you go to full screen and then go back. This is the most serious issue, but I suspect it'll be fixable and it's better than what we have right now. This should fix servo/servo#9431.
- Loading branch information