Remove invalid frames from window list

darcs
wayo.cavazos 2006-02-23 23:26:45 +00:00
parent 5be4477fab
commit 6fcc4972e3
1 changed files with 11 additions and 1 deletions

View File

@ -534,6 +534,15 @@ SYMBOL: workspace-menu
"Workspace 4" "Workspace 4"
[ workspace-4 get switch-to ] workspace-menu get add-popup-menu-item ; [ workspace-4 get switch-to ] workspace-menu get add-popup-menu-item ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: invalid-frame? ( <wm-frame> -- ? )
wm-frame-child window-id valid-window?+ not ;
: remove-invalid-frames ( -- )
window-table get hash-values [ wm-frame? ] subset [ invalid-frame? ] subset
[ window-id window-table get remove-hash ] each ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! window-list ! window-list
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -560,7 +569,8 @@ SYMBOL: window-list
: refresh-window-list ( window-list -- ) : refresh-window-list ( window-list -- )
dup window-children% [ destroy-window+ ] each dup window-children% [ destroy-window+ ] each
! clean-window-table clean-window-table
remove-invalid-frames
window-table get hash-values [ wm-frame? ] subset window-table get hash-values [ wm-frame? ] subset
[ not-transient? ] subset [ not-transient? ] subset
[ add-window-to-list ] each [ add-window-to-list ] each