stefansundin / superf4

:file_folder: Kill programs instantly with Ctrl+Alt+F4. (Windows)
https://stefansundin.github.io/superf4/
GNU General Public License v3.0
671 stars 40 forks source link

Fix keyboard input lag in some cases #5

Closed vmrob closed 7 years ago

vmrob commented 7 years ago

Previously, under certain conditions when entering a full screen application, Shell_NotifyIcon would repeatedly fail to add or modify the superf4 icon. When it did, the keyboard event hook would time out causing a large amount of input lag for every keystroke.

This patch works around the issue by attempting to add or modify the icon exactly once to avoid blocking the event loop.

vmrob commented 7 years ago

I encountered the same issue as mentioned in #1 and #4 and decided to go ahead and see what was going on. This resolved the issue for me.

vmrob commented 7 years ago

@stefansundin, have you had a chance to review this change?

stefansundin commented 7 years ago

Hi @vmrob. Sorry for not replying before.

I remember that the reason I added that infinite loop in the first place was because if you had the program on autostart, sometimes explorer would take a long time to fully load and initialize the tray area, and a lot of the time SuperF4 would try to add the icon too soon. I am pretty sure this was back in the XP days, so it might not be a problem anymore.

But yeah, I guess having a timer that tries to add the tray icon is a better solution if this problem comes up again. I'll merge this for now in any case.

Thanks!

NikhilVerma commented 1 year ago

This is incredible and kudos for the fix, its been bothering me for many years now