Make views explicitly layer-backed on macOS Mojave. (#685)

On Mojave, views automatically become layer-backed shortly after being added to
a window. Changing the layer-backedness of a view breaks the association
between the view and its associated OpenGL context. To work around this, on
Mojave we explicitly make the view layer-backed up front so that AppKit doesn't
do it itself and break the association with its context.

This was breaking the `window` example in `glutin`.
This commit is contained in:
Patrick Walton 2018-11-05 11:34:54 -08:00 committed by Francesca Plebani
parent 0fca8e8cb5
commit d2d127a4c4
3 changed files with 14 additions and 2 deletions

View file

@ -31,9 +31,9 @@ objc = "0.2.3"
[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2.3"
cocoa = "0.17"
cocoa = "0.18.4"
core-foundation = "0.6"
core-graphics = "0.16"
core-graphics = "0.17.3"
[target.'cfg(target_os = "windows")'.dependencies.winapi]
version = "0.3.6"