Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(win32): set foregroundlocktimeout explicitly
After another round of deep diving to find a workaround to all of the mechanisms within Windows that prevent a process from changing the focused window, I came across this gist which I saw setting SPI_SETFOREGROUNDLOCKTIMEOUT to 0: https://gist.github.com/EBNull/1419093 This tentatively seems like it works and it removes the need for the alt_focus_hack setting. However, according to this StackOverflow discussion, it seems like on Win10+ changes to ForegroundLockTimeout in the registry are no longer respected and changes made via SPI_SETFOREGROUNDLOCKTIMEOUT are not persisted: https://stackoverflow.com/questions/73735129/setforegroundwindow-relationship-between-the-foregroundlocktimeout-registry-val Therefore on starting, komorebi will now check the value with SPI_GETFOREGROUNDLOCKTIMEOUT and if it is not 0, it will be set to 0. Logging has been added to inform the user of the changes that are happening.
- Loading branch information