@@ -495,8 +495,11 @@ func (w *window) Configure(options []Option) {
495495 C .setWindowTitleVisibility (window , titleVis )
496496 C .setWindowStyleMask (window , mask )
497497 C .setWindowStandardButtonHidden (window , C .NSWindowCloseButton , barTrans )
498- C .setWindowStandardButtonHidden (window , C .NSWindowMiniaturizeButton , barTrans )
499- C .setWindowStandardButtonHidden (window , C .NSWindowZoomButton , barTrans )
498+ // no decorated or hide minimize and maximize buttons
499+ w .config .MinimizeButtonHidden = cnf .MinimizeButtonHidden
500+ w .config .MaximizeButtonHidden = cnf .MaximizeButtonHidden
501+ C .setWindowStandardButtonHidden (window , C .NSWindowMiniaturizeButton , toInt (! cnf .Decorated || cnf .MinimizeButtonHidden ))
502+ C .setWindowStandardButtonHidden (window , C .NSWindowZoomButton , toInt (! cnf .Decorated || cnf .MaximizeButtonHidden ))
500503 // When toggling the titlebar, the layer doesn't update its frame
501504 // until the next resize. Force it.
502505 C .resetLayerFrame (w .view )
@@ -1161,6 +1164,14 @@ func convertMods(mods C.NSUInteger) key.Modifiers {
11611164 return kmods
11621165}
11631166
1167+ // toInt golang bool to C.int
1168+ func toInt (v bool ) C.int {
1169+ if v {
1170+ return C .int (C .YES )
1171+ }
1172+ return C .int (C .NO )
1173+ }
1174+
11641175func (AppKitViewEvent ) implementsViewEvent () {}
11651176func (AppKitViewEvent ) ImplementsEvent () {}
11661177func (a AppKitViewEvent ) Valid () bool {
0 commit comments