internal/uidriver/glfw: Better implementation of isNativeFullscreen

The old implementation can return false when the window is not active.
This commit is contained in:
Hajime Hoshi 2021-08-08 17:45:44 +09:00
parent 15ac69b8d5
commit 4482301882

View File

@ -42,9 +42,12 @@ package glfw
// } // }
// } // }
// //
// static bool isNativeFullscreen() { // static bool isNativeFullscreen(uintptr_t windowPtr) {
// return [[NSApplication sharedApplication] currentSystemPresentationOptions] & // if (!windowPtr) {
// NSApplicationPresentationFullScreen; // return false;
// }
// NSWindow* window = (NSWindow*)windowPtr;
// return (window.styleMask & NSWindowStyleMaskFullScreen) != 0;
// } // }
// //
// static void setNativeCursor(int cursorID) { // static void setNativeCursor(int cursorID) {
@ -118,7 +121,7 @@ func (u *UserInterface) nativeWindow() uintptr {
} }
func (u *UserInterface) isNativeFullscreen() bool { func (u *UserInterface) isNativeFullscreen() bool {
return bool(C.isNativeFullscreen()) return bool(C.isNativeFullscreen(C.uintptr_t(u.window.GetCocoaWindow())))
} }
func (u *UserInterface) setNativeCursor(shape driver.CursorShape) { func (u *UserInterface) setNativeCursor(shape driver.CursorShape) {