From: Brendan Shanks bshanks@codeweavers.com
--- dlls/winemac.drv/cocoa_opengl.m | 4 +++- dlls/winemac.drv/cocoa_window.m | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m index 5e3ad03a8b2..6a88519e5db 100644 --- a/dlls/winemac.drv/cocoa_opengl.m +++ b/dlls/winemac.drv/cocoa_opengl.m @@ -51,6 +51,7 @@ - (void) dealloc + (NSView*) dummyView { static NSWindow* dummyWindow; + static NSView* dummyWindowContentView; static dispatch_once_t once;
dispatch_once(&once, ^{ @@ -59,10 +60,11 @@ + (NSView*) dummyView styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]; + dummyWindowContentView = dummyWindow.contentView; }); });
- return dummyWindow.contentView; + return dummyWindowContentView; }
// Normally, we take care that disconnecting a context from a view doesn't diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 4c15e211442..7aa3dbf81c7 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -3783,16 +3783,16 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma { @autoreleasepool { - WineContentView* view = (WineContentView*)v; - WineContentView* superview = (WineContentView*)s; - WineWindow* window = (WineWindow*)w; - WineContentView* prev = (WineContentView*)p; - WineContentView* next = (WineContentView*)n; + OnMainThreadAsync(^{ + WineContentView* view = (WineContentView*)v; + WineContentView* superview = (WineContentView*)s; + WineWindow* window = (WineWindow*)w; + WineContentView* prev = (WineContentView*)p; + WineContentView* next = (WineContentView*)n;
- if (!superview) - superview = [window contentView]; + if (!superview) + superview = [window contentView];
- OnMainThreadAsync(^{ if (superview == [view superview]) { NSArray* subviews = [superview subviews];