sdias / win-10-virtual-desktop-enhancer

An application that enhances the Windows 10 multiple desktops feature by adding additional keyboard shortcuts and support for multiple wallpapers.
MIT License
1.77k stars 269 forks source link

Fixed focus management. #67

Closed GioBonvi closed 7 years ago

GioBonvi commented 7 years ago

Rewrote the _Focus() function to give focus to the foremost window in the desktop.

Replaced the _FocusIfRequested() function with _Focus().

Had to update the library to the latest version as the IsWindowOnDesktopNumber function seemed not to work in the version previoulsy used.

This solves #64 and possibly even the glitch of the flashing orange icons in the taskbar: I could not reproduce it in my tests for this version of the code, while with the stable release it happened quite often.

sdias commented 7 years ago

Good work all around, I just had a few comments. :)

sdias commented 7 years ago

It feels a lot more responsive, great work, the solution is pretty elegant too. I did notice a bit of an annoying behavior though. If I'm playing a game in fullscreen windowed mode, when I switch to that desktop it focus on the game, which then grabs the cursor and places it in the center of the screen, but since the tooltip for the desktop is still there, if you try clicking you actually end up clicking the tooltip, so you kind of have to wait for the tooltip to disappear. I think we should make it so that clicks on the tooltip pass through it and click whatever window is below it instead. I know that currently, we use a click on the tooltip to dismiss it, but it is shown for so little time that that use case is not very useful in my opinion. If users don't agree, we can make it configurable. What do you think?

GioBonvi commented 7 years ago

You are right, probably noone has ever used the dismiss-on-click function: popups are just too fast; making popups click-through is the best solution for me.

Should I open another branch and pull request or can we attach it to this one?

sdias commented 7 years ago

Maybe do it in a separate PR to make it easier to review. Thanks.

GioBonvi commented 7 years ago

Ok, doing it now.

Can this be merged?

sdias commented 7 years ago

Yes, I'll merge it. Going forward I'll do proper reviews so you can know when I fully reviewed it and approved it, so that then you can merge it when you want.