[Win32] Avoid faulty setting of image list at OS on Tree.setOrientation#3077
Merged
fedejeanne merged 1 commit intoMar 3, 2026
Merged
Conversation
1 task
Contributor
Test Results (win32) 34 files 34 suites 5m 25s ⏱️ Results for commit c012752. ♻️ This comment has been updated with latest results. |
1f2f51a to
658e63b
Compare
658e63b to
c012752
Compare
c012752 to
9bc1593
Compare
Contributor
9bc1593 to
33da9ff
Compare
The Windows Tree implementation only registers an image list at the OS control in case an image is set in the first column of an item of the tree. For images in the other columns, they are added to an SWT image list but since the images are embedded by SWT, no image list is registered at the OS. The implementation of Tree.updateOrientation() does not consider that for the OS control no image list may have been set even if the SWT control manages an image list. As a consequence, calling Tree.setOrientation() on a Tree whose items do not have any image in the first column leads to all those items receiving a white space where an image might be placed as an empty image list is registered at the OS. This change adapts the Tree.updateOrientation() implementation to only refresh the OS image list for the control in case one was already set before. In addition to calling Tree.setOrientation() this also affects DPI changes when moving the containing shell to a monitor with a different zoom where the same happens because of a call to Tree.updateOrientation(). Contributes to eclipse-platform#3075
33da9ff to
60ac3a1
Compare
fedejeanne
approved these changes
Mar 3, 2026
Member
fedejeanne
left a comment
There was a problem hiding this comment.
Looks good and works as expected. I added the snippet too.
fedejeanne
added a commit
to vi-eclipse/eclipse.platform.swt
that referenced
this pull request
Mar 3, 2026
fedejeanne
added a commit
to vi-eclipse/eclipse.platform.swt
that referenced
this pull request
Mar 3, 2026
HeikoKlare
pushed a commit
that referenced
this pull request
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Windows Tree implementation only registers an image list at the OS control in case an image is set in the first column of an item of the tree. For images in the other columns, they are added to an SWT image list but since the images are embedded by SWT, no image list is registered at the OS.
The implementation of Tree.updateOrientation() does not consider that for the OS control no image list may have been set even if the SWT control manages an image list. As a consequence, calling Tree.setOrientation() on a Tree whose items do not have any image in the first column leads to all those items receiving a white space where an image might be placed as an empty image list is registered at the OS.
This change adapts the Tree.updateOrientation() implementation to only refresh the OS image list for the control in case one was already set before. In addition to calling Tree.setOrientation() this also affects DPI changes when moving the containing shell to a monitor with a different zoom where the same happens because of a call to Tree.updateOrientation().
Fixes #3075
How to reproduce
Execute this snippet:
With the current code state it gives:

With this change (and without the call to

tree.setOrientation()) it gives: