From: Brendan Shanks bshanks@codeweavers.com
--- dlls/winemac.drv/cocoa_opengl.m | 5 +++++ dlls/winemac.drv/cocoa_window.m | 9 +++++++++ 2 files changed, 14 insertions(+)
diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m index 3e5f682613a..2801834e825 100644 --- a/dlls/winemac.drv/cocoa_opengl.m +++ b/dlls/winemac.drv/cocoa_opengl.m @@ -31,6 +31,7 @@
@interface WineOpenGLContext () @property (retain, nonatomic) NSView* latentView; +@property (nullable, weak) NSView *view; /* redeclare this to avoid NSOpenGLContext's deprecation warnings */
+ (NSView*) dummyView; - (void) wine_updateBackingSize:(const CGSize*)size; @@ -39,6 +40,7 @@ - (void) wine_updateBackingSize:(const CGSize*)size;
@implementation WineOpenGLContext +@dynamic view; @synthesize latentView, needsUpdate, needsReattach;
- (void) dealloc @@ -82,6 +84,8 @@ - (void) resetSurfaceIfBackingSizeChanged macdrv_set_view_backing_size((macdrv_view)self.view, view_backing);
NSView* save = self.view; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if ([NSThread isMainThread]) { [super clearDrawable]; @@ -91,6 +95,7 @@ - (void) resetSurfaceIfBackingSizeChanged [super clearDrawable]; [super setView:save]; }); +#pragma clang diagnostic pop } }
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index d8d2ebf5178..19c8fef4246 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -731,7 +731,10 @@ - (void) setRetinaMode:(BOOL)mode frame.size.width *= scale; frame.size.height *= scale; [self setFrame:frame]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [self setWantsBestResolutionOpenGLSurface:mode]; +#pragma clang diagnostic pop [self updateGLContexts]; [self setLayerRetinaProperties:mode];
@@ -3736,11 +3739,14 @@ macdrv_view macdrv_create_view(CGRect rect) view = [[WineContentView alloc] initWithFrame:NSRectFromCGRect(cgrect_mac_from_win(rect))]; [view setAutoresizingMask:NSViewNotSizable]; [view setHidden:YES]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [view setWantsBestResolutionOpenGLSurface:retina_on]; [nc addObserver:view selector:@selector(updateGLContexts) name:NSViewGlobalFrameDidChangeNotification object:view]; +#pragma clang diagnostic pop [nc addObserver:view selector:@selector(updateGLContexts) name:NSApplicationDidChangeScreenParametersNotification @@ -3766,9 +3772,12 @@ void macdrv_dispose_view(macdrv_view v) NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; WineWindow* window = (WineWindow*)[view window];
+#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [nc removeObserver:view name:NSViewGlobalFrameDidChangeNotification object:view]; +#pragma clang diagnostic pop [nc removeObserver:view name:NSApplicationDidChangeScreenParametersNotification object:NSApp];