Pass zero for fullscreen flags on non Cocoa platforms

This commit is contained in:
Kovid Goyal 2019-05-12 16:07:54 +05:30
parent 10a987b908
commit 3e964163c0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -2004,7 +2004,7 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) { bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) {
NSWindow *window = w->ns.object; NSWindow *window = w->ns.object;
bool made_fullscreen = true; bool made_fullscreen = true;
bool traditional = flags & 1; bool traditional = !(flags & 1);
NSWindowStyleMask sm = [window styleMask]; NSWindowStyleMask sm = [window styleMask];
bool in_fullscreen = sm & NSWindowStyleMaskFullScreen; bool in_fullscreen = sm & NSWindowStyleMaskFullScreen;
if (traditional) { if (traditional) {

View File

@ -364,7 +364,7 @@ do_toggle_fullscreen(OSWindow *w) {
int width, height, x, y; int width, height, x, y;
glfwGetWindowSize(w->handle, &width, &height); glfwGetWindowSize(w->handle, &width, &height);
glfwGetWindowPos(w->handle, &x, &y); glfwGetWindowPos(w->handle, &x, &y);
if (glfwToggleFullscreen(w->handle, 1)) { if (glfwToggleFullscreen(w->handle, 0)) {
w->before_fullscreen.is_set = true; w->before_fullscreen.is_set = true;
w->before_fullscreen.w = width; w->before_fullscreen.h = height; w->before_fullscreen.x = x; w->before_fullscreen.y = y; w->before_fullscreen.w = width; w->before_fullscreen.h = height; w->before_fullscreen.x = x; w->before_fullscreen.y = y;
return true; return true;
@ -380,7 +380,7 @@ static bool
toggle_fullscreen_for_os_window(OSWindow *w) { toggle_fullscreen_for_os_window(OSWindow *w) {
if (w && w->handle) { if (w && w->handle) {
#ifdef __APPLE__ #ifdef __APPLE__
if (!OPT(macos_traditional_fullscreen)) return glfwToggleFullscreen(w->handle, 0); if (!OPT(macos_traditional_fullscreen)) return glfwToggleFullscreen(w->handle, 1);
#endif #endif
return do_toggle_fullscreen(w); return do_toggle_fullscreen(w);
} }