internal/ui: bug fix: wrong bit operations

Closes #2349
This commit is contained in:
Hajime Hoshi 2022-09-25 20:10:31 +09:00
parent 9302230fef
commit e47f9ac38f

View File

@ -282,11 +282,11 @@ func (u *userInterfaceImpl) setNativeFullscreen(fullscreen bool) {
// toggleFullscreen doesn't work when the window is not resizable.
origFullScreen := window.Send(sel_collectionBehavior)&cocoa.NSWindowCollectionBehaviorFullScreenPrimary != 0
if !origFullScreen {
window.Send(sel_setCollectionBehavior, window.Send(sel_collectionBehavior)|cocoa.NSWindowCollectionBehaviorFullScreenPrimary)
window.Send(sel_setCollectionBehavior, cocoa.NSUInteger(window.Send(sel_collectionBehavior))|cocoa.NSWindowCollectionBehaviorFullScreenPrimary)
}
window.Send(objc.RegisterName("toggleFullScreen:"), 0)
if !origFullScreen {
window.Send(sel_setCollectionBehavior, window.Send(sel_collectionBehavior)&cocoa.NSWindowCollectionBehaviorFullScreenPrimary)
window.Send(sel_setCollectionBehavior, cocoa.NSUInteger(window.Send(sel_collectionBehavior))&^cocoa.NSUInteger(cocoa.NSWindowCollectionBehaviorFullScreenPrimary))
}
}