diff options
Diffstat (limited to 'src/video/cocoa/fullscreen.mm')
-rw-r--r-- | src/video/cocoa/fullscreen.mm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/video/cocoa/fullscreen.mm b/src/video/cocoa/fullscreen.mm index e41849c70..aa28422d3 100644 --- a/src/video/cocoa/fullscreen.mm +++ b/src/video/cocoa/fullscreen.mm @@ -293,9 +293,6 @@ class FullscreenSubdriver: public CocoaSubdriver { mouseLocation.x /= this->device_width; mouseLocation.y /= this->device_height; - /* Hide mouse in order to avoid glitch in 8bpp */ - QZ_HideMouse(); - /* Fade display to zero gamma */ OTTD_QuartzGammaTable gamma_table; gamma_error = this->FadeGammaOut(&gamma_table); @@ -333,6 +330,9 @@ class FullscreenSubdriver: public CocoaSubdriver { /* If we don't hide menu bar, it will get events and interrupt the program */ HideMenuBar(); + /* Hide the OS cursor */ + CGDisplayHideCursor(this->display_id); + /* Fade the display to original gamma */ if (!gamma_error) FadeGammaIn(&gamma_table); @@ -352,6 +352,8 @@ class FullscreenSubdriver: public CocoaSubdriver { display_mouseLocation.x = mouseLocation.x * this->device_width; display_mouseLocation.y = this->device_height - (mouseLocation.y * this->device_height); + _cursor.in_window = true; + CGDisplayMoveCursorToPoint(this->display_id, display_mouseLocation); return true; @@ -384,6 +386,9 @@ ERR_NO_MATCH: CGReleaseAllDisplays(); + /* Bring back the cursor */ + CGDisplayShowCursor(this->display_id); + ShowMenuBar(); /* Reset the main screen's rectangle @@ -391,8 +396,6 @@ ERR_NO_MATCH: NSRect screen_rect = NSMakeRect(0, 0, CGDisplayPixelsWide(this->display_id), CGDisplayPixelsHigh(this->display_id)); [ [ NSScreen mainScreen ] setFrame:screen_rect ]; - QZ_ShowMouse(); - /* Destroy the pixel buffer */ if (this->pixel_buffer != NULL) { free(this->pixel_buffer); |