diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:35:38 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:35:38 +0000 |
commit | 6d50b1007457da26a11f05a5ba53880907d26cef (patch) | |
tree | 87c8b6946eb3bac1bf87a9c48a60b446d3a74f24 /src/video | |
parent | a31be4ce1152ec7f7819c657dffcdb83673a4000 (diff) | |
download | openttd-6d50b1007457da26a11f05a5ba53880907d26cef.tar.xz |
(svn r25655) -Fix: [OSX] Mouse cursor wasn't displayed properly after switching to fullscreen on 10.7+. (Based on patch by Maedhros)
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/cocoa/cocoa_v.h | 1 | ||||
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 9f7f55c7c..06bbbfdb2 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -253,6 +253,7 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i - (void)setDriver:(CocoaSubdriver*)drv; - (BOOL)windowShouldClose:(id)sender; +- (void)windowDidEnterFullScreen:(NSNotification *)aNotification; @end diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 9e883928b..ca81715b1 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -776,6 +776,14 @@ void cocoaReleaseAutoreleasePool() { driver->active = false; } +/** Window entered fullscreen mode (10.7). */ +- (void)windowDidEnterFullScreen:(NSNotification *)aNotification +{ + NSPoint loc = [ driver->cocoaview convertPoint:[ [ aNotification object ] mouseLocationOutsideOfEventStream ] fromView:nil ]; + BOOL inside = ([ driver->cocoaview hitTest:loc ] == driver->cocoaview); + + if (inside) [ driver->cocoaview mouseEntered:NULL ]; +} @end |