I have a detached dialog that monitors a tab for changes, including selection changes, using dialog.watchtab. Selection changes are detected perfectly if selections within the tab are applied directly - i.e. by clicking items or ranges - but not if they are applied indirectly - e.g. via a button that executes a filter.
filter event fire in the situations you're looking at?
Yes. The selection changes but the tab event is not triggered.
If the script's aim is to track everything that is/isn't currently selected, I think you'd need to listen for both events, and if the filter event fires it means all selections may have changed and the selection list should be re-built.
In a sense, the files aren't being de-selected, they're being removed from (filtered out of) the file display entirely.
The relevant WatchTab code is loopDlg.WatchTab(curTab,",add,delete,filter,navigate,select");
Further testing shows that if my test Select FILTER test FILTERFLAGS=select DESELECTNOMATCH command is executed (e.g. using a hotkey to fire the Select command) from within the script that is the parent of the detached dialog, the tab event is triggered correctly but if exactly the same command is run externally as an "instant" command >Select FILTER test FILTERFLAGS=select DESELECTNOMATCH the tab event is not triggered. Manually clicking items or selecting ranges of items also triggers the tab event.