app,app/internal/wm: implement ViewEvent for macOS

Move the deprecated setWantsBestResolutionOpenGLSurface to GL-specific
code while we're here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-05-16 14:57:20 +02:00
parent 413bff8766
commit 1ec408280e
9 changed files with 46 additions and 5 deletions
+6 -2
View File
@@ -300,12 +300,16 @@ void gio_setTitle(CFTypeRef windowRef, const char *title) {
window.title = [NSString stringWithUTF8String: title];
}
CFTypeRef gio_layerForView(CFTypeRef viewRef) {
NSView *view = (__bridge NSView *)viewRef;
return (__bridge CFTypeRef)view.layer;
}
CFTypeRef gio_createView(void) {
@autoreleasepool {
NSRect frame = NSMakeRect(0, 0, 0, 0);
GioView* view = [[GioView alloc] initWithFrame:frame];
[view setWantsBestResolutionOpenGLSurface:YES];
[view setWantsLayer:YES]; // The default in Mojave.
[view setWantsLayer:YES];
return CFBridgingRetain(view);
}
}