From 59eac4f1d1aaa56a852e97b19013e08a4d6d6a87 Mon Sep 17 00:00:00 2001 From: nanochess Date: Mon, 5 Mar 2018 12:45:56 -0600 Subject: [PATCH] Desired desktop resolution minus dock for Mac OS X (requires SDL-2.0.5 or higher) --- src/common/FrameBufferSDL2.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index 1bc71db6f..af67cbb8b 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -88,14 +88,24 @@ void FrameBufferSDL2::queryHardware(vector& displays, ASSERT_MAIN_THREAD; // First get the maximum windowed desktop resolution - SDL_DisplayMode display; int maxDisplays = SDL_GetNumVideoDisplays(); +#if 0 //def BSPF_MAC_OSX + SDL_Rect r; + for(int i = 0; i < maxDisplays; ++i) + { + // Display bounds minus dock + SDL_GetDisplayUsableBounds(i, &r); // Requires SDL-2.0.5 or higher + displays.emplace_back(r.w, r.h); + } +#else + SDL_DisplayMode display; for(int i = 0; i < maxDisplays; ++i) { SDL_GetDesktopDisplayMode(i, &display); displays.emplace_back(display.w, display.h); } - +#endif + struct RenderName { string sdlName;