I noticed that on my Linux system, the ALLEGRO_EVENT_DISPLAY_SWITCH_IN is only generated when clicking on a window, but not when alt-tabbing.
So:
Run a game window
Click outside the window
Click on the window again
-> ALLEGRO_EVENT_DISPLAY_SWITCH_IN is generated
Run a game window
Alt-tab to a different window
Alt-tab to the game window again
-> NO event generated
I would expect the behavior to be the same in both cases, as indeed it is on my Windows system.
I noticed this problem with Allegro 5.2.8.0 and Ubuntu 22.04.