
You can tell Windows to strictly enforce a timeout, which prevents background applications from claiming the active window status.
⚠️ Note: Editing the Registry can cause issues if done incorrectly. It is highly recommended to before proceeding.
Press Win + R, type regedit, and press Enter.
In the left sidebar, navigate to the following folder:
HKEY_CURRENT_USER\Control Panel\Desktop
On the right side, look for a value named ForegroundLockTimeout.
If it doesn't exist: Right-click in the empty space, select New > DWORD (32-bit) Value, and name it ForegroundLockTimeout.
Double-click ForegroundLockTimeout.
Set the Base to Decimal and change the Value data to 200000 (which represents a 200,000-millisecond / 3-minute delay before any background window is allowed to steal focus).
Click OK.
Navigate to the value named ForegroundFlashCount in the same folder. Double-click it, select Decimal, and set the value to 3 (this will make the taskbar icon flash 3 times instead of pulling the window forward). Click OK.
Close the Registry Editor and restart your computer for the changes to take effect.