FrigoCoder/FrigoTab

Background image is messed up on Windows 10

FrigoCoder opened this issue · 2 comments

Something about GetWindowRect and DPI awareness causes the background image to give wrong dimensions. As a result the background image, sometimes along with icons, are stretched horizonally and pixelated.

So the underlying issue is that DwmQueryThumbnailSize reports wrong dimensions for the background images. We can swap it for GetWindowRect, but then we can no longer handle minimized applications. Need to separate logic for ApplicationWindow and BackgroundWindow.

Solved issue by introducing Thumbnail.SetSourceRect. We are not calling it for ApplicationWindows so it uses the entire application as thumbnail. For BackgroundWindows we use Dwm.GetExtendedFrameBounds and ScreenToClient.