summaryrefslogtreecommitdiff
path: root/src/video/cocoa/wnd_quartz.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/cocoa/wnd_quartz.mm')
-rw-r--r--src/video/cocoa/wnd_quartz.mm17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm
index 795a311bc..d42749bac 100644
--- a/src/video/cocoa/wnd_quartz.mm
+++ b/src/video/cocoa/wnd_quartz.mm
@@ -333,7 +333,9 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
[ this->window setAcceptsMouseMovedEvents:YES ];
[ this->window setViewsNeedDisplay:NO ];
- [ this->window useOptimizedDrawing:YES ];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
+ if ([ this->window respondsToSelector:@selector(useOptimizedDrawing:) ]) [ this->window useOptimizedDrawing:YES ];
+#endif
delegate = [ [ OTTD_CocoaWindowDelegate alloc ] init ];
[ delegate setDriver:this ];
@@ -517,7 +519,16 @@ CGPoint WindowQuartzSubdriver::PrivateLocalToCG(NSPoint *p)
p->y = this->window_height - p->y;
*p = [ this->cocoaview convertPoint:*p toView:nil ];
- *p = [ this->window convertBaseToScreen:*p ];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ if ([ this->window respondsToSelector:@selector(convertRectToScreen:) ]) {
+ *p = [ this->window convertRectToScreen:NSMakeRect(p->x, p->y, 0, 0) ].origin;
+ } else
+#endif
+ {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
+ *p = [ this->window convertBaseToScreen:*p ];
+#endif
+ }
p->y = this->device_height - p->y;
CGPoint cgp;
@@ -539,7 +550,9 @@ NSPoint WindowQuartzSubdriver::GetMouseLocation(NSEvent *event)
else
#endif
{
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
pt = [ this->cocoaview convertPoint:[ [ this->cocoaview window ] convertScreenToBase:[ event locationInWindow ] ] fromView:nil ];
+#endif
}
} else {
pt = [ event locationInWindow ];