File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ class Windows {
308308        if  let  cgWindowId =  window. cgWindowId { 
309309            let  spaceIds  =  cgWindowId. spaces ( ) 
310310            window. spaceIds =  spaceIds
311-             window. spaceIndexes =  spaceIds. map  {  spaceId in  Spaces . idsAndIndexes. first  {  $0. 0  ==  spaceId } ! . 1  } 
311+             window. spaceIndexes =  spaceIds. compactMap  {  spaceId in  Spaces . idsAndIndexes. first  {  $0. 0  ==  spaceId } ? . 1  } 
312312            window. isOnAllSpaces =  spaceIds. count >  1 
313313        } 
314314    } 
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ class ScreensEvents {
77
88    @objc   private  static  func  handleEvent( _ notification:  Notification )  { 
99        Logger . debug ( notification. name. rawValue) 
10+         Spaces . refresh ( ) 
11+         // a screen added or removed, or screen resolution change can mess up layout; we reset components
12+         App . app. resetPreferencesDependentComponents ( ) 
1013        // a screen added or removed can shuffle windows around Spaces; we refresh them
1114        App . app. refreshOpenUi ( Windows . list,  . refreshUiAfterExternalEvent) 
1215        Logger . info ( " screens " ,  NSScreen . screens. map  {  ( $0. uuid ( )  ??  " nil "  as  CFString ,  $0. frame)  } ) 
1316        Logger . info ( " spaces " ,  Spaces . screenSpacesMap) 
1417        Logger . info ( " current space " ,  Spaces . currentSpaceIndex,  Spaces . currentSpaceId) 
15-         // a screen added or removed, or screen resolution change can mess up layout; we reset components
16-         App . app. resetPreferencesDependentComponents ( ) 
1718    } 
1819} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments