[PATCH] winemac: Fix a crash on versions of OS X prior to 10.9 which don't have the -[NSImage drawInRect:] method.

Ken Thomases ken at codeweavers.com
Tue Nov 10 02:29:18 CST 2015


[image drawInRect:rect] is documented as being "exactly equivalent to calling
[image drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver
fraction:1 respectFlipped:YES hints:nil]".  So, that's what I replace it with.

Signed-off-by: Ken Thomases <ken at codeweavers.com>
---
 dlls/winemac.drv/cocoa_window.m | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 666a953..7aa88cc 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -1788,7 +1788,12 @@ - (void) grabDockIconSnapshotFromWindow:(WineWindow*)window force:(BOOL)force
         }
 
         CGContextDrawImage(cgcontext, rect, windowImage);
-        [appImage drawInRect:NSMakeRect(156, 4, 96, 96)];
+        [appImage drawInRect:NSMakeRect(156, 4, 96, 96)
+                    fromRect:NSZeroRect
+                   operation:NSCompositeSourceOver
+                    fraction:1
+              respectFlipped:YES
+                       hints:nil];
 
         [dockIcon unlockFocus];
 
-- 
2.6.0




More information about the wine-patches mailing list