File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -251,16 +251,15 @@ class Windows {
251251        for  (index,  cgWindowId)  in  Spaces . windowsInSpaces ( Spaces . visibleSpaces) . enumerated ( )  { 
252252            windowLevelMap [ cgWindowId]  =  index
253253        } 
254-         var  orderForUnlistedWindows  =  Int . max
255-         for  window  in  list { 
256-             if  let  listedOrder =  windowLevelMap [ window. cgWindowId]  { 
257-                 window. lastFocusOrder =  listedOrder
258-             }  else  { 
259-                 window. lastFocusOrder =  orderForUnlistedWindows
260-                 orderForUnlistedWindows -=  1 
261-             } 
262-         } 
263-         list. sort  {  $0. lastFocusOrder <  $1. lastFocusOrder } 
254+         list =  list
255+                 . sorted  {  w1,  w2 in 
256+                     ( windowLevelMap [ w1. cgWindowId]  ??  . max)  <  ( windowLevelMap [ w2. cgWindowId]  ??  . max) 
257+                 } 
258+                 . enumerated ( ) 
259+                 . map  {  ( index,  window)  ->  Window  in 
260+                     window. lastFocusOrder =  index
261+                     return  window
262+                 } 
264263    } 
265264
266265    static  func  refreshThumbnailsAsync( _ screen:  NSScreen ,  _ currentIndex:  Int )  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments