@@ -262,8 +262,9 @@ fn create_window(
262262 NSWindowButton :: CloseButton ,
263263 NSWindowButton :: ZoomButton ,
264264 ] {
265- let button = ns_window. standardWindowButton ( * titlebar_button) . unwrap ( ) ;
266- let _: ( ) = msg_send ! [ & button, setHidden: true ] ;
265+ if let Some ( button) = ns_window. standardWindowButton ( * titlebar_button) {
266+ button. setHidden ( true ) ;
267+ }
267268 }
268269 }
269270 if pl_attrs. movable_by_window_background {
@@ -283,10 +284,10 @@ fn create_window(
283284 }
284285
285286 if !attrs. maximizable {
286- let button = ns_window
287- . standardWindowButton ( NSWindowButton :: ZoomButton )
288- . unwrap ( ) ;
289- button . setEnabled ( false ) ;
287+ if let Some ( button) = ns_window
288+ . standardWindowButton ( NSWindowButton :: ZoomButton ) {
289+ button . setEnabled ( false ) ;
290+ }
290291 }
291292
292293 if let Some ( increments) = pl_attrs. resize_increments {
@@ -769,11 +770,12 @@ impl UnownedWindow {
769770 #[ inline]
770771 pub fn set_maximizable ( & self , maximizable : bool ) {
771772 unsafe {
772- let button = self
773+ if let Some ( button) = self
773774 . ns_window
774775 . standardWindowButton ( NSWindowButton :: ZoomButton )
775- . unwrap ( ) ;
776- button. setEnabled ( maximizable) ;
776+ {
777+ button. setEnabled ( maximizable) ;
778+ }
777779 }
778780 }
779781
@@ -962,7 +964,7 @@ impl UnownedWindow {
962964 let mask = self . saved_style ( & mut * shared_state_lock) ;
963965
964966 drop ( shared_state_lock) ;
965- trace ! ( "Unocked shared state in `restore_state_from_fullscreen`" ) ;
967+ trace ! ( "Unlocked shared state in `restore_state_from_fullscreen`" ) ;
966968
967969 self . set_style_mask_async ( mask) ;
968970 self . set_maximized ( maximized) ;
@@ -1040,15 +1042,16 @@ impl UnownedWindow {
10401042
10411043 #[ inline]
10421044 pub fn is_maximizable ( & self ) -> bool {
1043- let is_maximizable: bool ;
10441045 unsafe {
1045- let button = self
1046+ if let Some ( button) = self
10461047 . ns_window
10471048 . standardWindowButton ( NSWindowButton :: ZoomButton )
1048- . unwrap ( ) ;
1049- is_maximizable = msg_send ! [ & button, isEnabled] ;
1049+ {
1050+ button. isEnabled ( )
1051+ } else {
1052+ false
1053+ }
10501054 }
1051- is_maximizable
10521055 }
10531056
10541057 #[ inline]
0 commit comments