Skip to content

Conversation

HeikoKlare
Copy link
Contributor

The algorithm to identify the best fitting image set to a decorations/shell instance for a specific size required by the OS currently only considers the difference between the target size and the actual size of the image. Smaller and larger images with the same difference are treated equally. However, usually one wants to prefer downscaling a higher-resolution image than upscaling a lower-resolution one to improve the quality.

This change ensures that larger images are preferred over smaller images if the difference is 1.5 times as high or less. One particular change is that on a 150% monitor now a 200% image will be downscaled instead of upscaling a 100% image.

Copy link
Contributor

github-actions bot commented Aug 30, 2025

Test Results

   539 files   -  7     539 suites   - 7   33m 29s ⏱️ + 1m 57s
 4 372 tests  - 54   4 357 ✅  - 52   14 💤  - 3  0 ❌ ±0  1 🔥 +1 
16 696 runs   - 54  16 571 ✅  - 52  124 💤  - 3  0 ❌ ±0  1 🔥 +1 

For more details on these errors, see this check.

Results for commit c61529c. ± Comparison against base commit f6de513.

This pull request removes 54 tests.
AllWin32Tests ImageWin32Tests ‑ testDisposeDrawnImageBeforeRequestingTargetForOtherZoom
AllWin32Tests ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[1] true
AllWin32Tests ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[2] false
AllWin32Tests ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
AllWin32Tests ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
AllWin32Tests ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[1] true
AllWin32Tests ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[2] false
AllWin32Tests TestTreeColumn ‑ test_ColumnOrder
AllWin32Tests Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
AllWin32Tests Test_org_eclipse_swt_dnd_DND ‑ testFileTransfer
…

♻️ This comment has been updated with latest results.

The algorithm to identify the best fitting image set to a
decorations/shell instance for a specific size required by the OS
currently only considers the difference between the target size and the
actual size of the image. Smaller and larger images with the same
difference are treated equally. However, usually one wants to prefer
downscaling a higher-resolution image than upscaling a lower-resolution
one to improve the quality.

This change ensures that larger images are preferred over smaller images
if the difference is 1.5 times as high or less. One particular change is
that on a 150% monitor now a 200% image will be downscaled instead of
upscaling a 100% image.
@HeikoKlare HeikoKlare force-pushed the better-window-icon-calculation branch from 9f08c6b to c61529c Compare September 2, 2025 10:39
@HeikoKlare HeikoKlare marked this pull request as ready for review September 2, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefer downscaling high-resolution shell images over upscaling smaller ones
1 participant