cmdtab icon indicating copy to clipboard operation
cmdtab copied to clipboard

add DPI awareness, fix resource translation

Open german-one opened this issue 8 months ago • 4 comments

Make the app DPI aware to avoid blurry window content.
closes #10

Fix encoding and translation values in the resource script.
related #11

german-one avatar Apr 16 '25 16:04 german-one

Probably I should've added some screenshots 😄 (HiDPI display, 150% scaling)

FWIW In the below table, images are resized to fit into the cells. If you open them in separate browser tabs you'll see that the switcher window is rendered smaller when it is DPI aware.

new before
icons_new icons_old
msg_new msg_old
name_new name_old

Last line is the encoding thing.

EDIT: Thanks to the screenshots, I realized that I forgot to add the visual styles to the manifest.

german-one avatar Apr 18 '25 10:04 german-one

After your explanation in #10, I think I prefer the SetProcessDPIAware()-route. I've yet to test it myself, but have implemented changes locally like yours in #11 to enable my new toolchain, test this change, and eventually pick up another release.

I'm unhappy about the text padding. I will have to inspect how Microsoft's Alt-Tab scales the window title, window preview, and paddings, and go for something equivalent. The way it looks in your screenshot is no good, although I will accept it temporarily.

I will accept this pull request with these changes: go from using the manifest file to using SetProcessDPIAware().

Thanks for the contribution :)

stianhoiland avatar Apr 22 '25 13:04 stianhoiland

I'm unhappy about the text padding.

I failed to calculate it based on the text measuring performed a few lines above. Let me try again. The reason why it was necessary to update the padding is that the text size appears still the same as before, while DPI awareness makes that the window is rendered smaller.

german-one avatar Apr 22 '25 15:04 german-one

Now the text is vertically centered in the gap between icon and window bottom. It looks like being closer to the icon because the selection rectangle is bigger than the icon. What do you think?
Screenshot 2025-04-22 184242

german-one avatar Apr 22 '25 16:04 german-one

Proper DPI scaling support added in a7972f9. Thanks for kicking things off and documenting issues that needed addressing. Finally closing this now :)

stianhoiland avatar Oct 04 '25 23:10 stianhoiland