From 37a0c1d6c1fa0038e8ada3f0f191c0e38f7bd09e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 18 Jun 2018 22:43:37 +0300 Subject: [PATCH] - implemented fullscreen toggle in Cocoa backend Window size and position are not saved yet --- src/posix/cocoa/i_video.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index c7c93d7f54..39f744e277 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -204,6 +204,7 @@ public: virtual DFrameBuffer* CreateFrameBuffer(); + static void ToggleFullscreen(bool yes); static bool IsFullscreen(); static void UseHiDPI(bool hiDPI); static void SetCursor(NSCursor* cursor); @@ -374,6 +375,14 @@ DFrameBuffer* CocoaVideo::CreateFrameBuffer() return fb; } +void CocoaVideo::ToggleFullscreen(bool yes) +{ + if (CocoaVideo* const video = GetInstance()) + { + video->SetMode(yes, video->m_hiDPI); + } +} + bool CocoaVideo::IsFullscreen() { CocoaVideo* const video = GetInstance(); @@ -555,7 +564,7 @@ bool SystemFrameBuffer::IsFullscreen() void SystemFrameBuffer::ToggleFullscreen(bool yes) { - SetMode(...); // todo + CocoaVideo::ToggleFullscreen(yes); }