Skip to content

Commit 3e1cc4f

Browse files
committed
[Win32] Properly reinitialize image of items on DPI changes
The current logic for reinitializing the image of an item on DPI changes is insufficient as the default implementation of the called setImage() method and many of the overwrites of that method do an early return in case the image equals to the one that has already been set. In order to force a reinitialization of the image, this change ensures that the image is first removed and then reset. Fixes #3073
1 parent dea17df commit 3e1cc4f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Item.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ private void handleDPIChange(Event event) {
230230
// Refresh the image
231231
Image image = getImage();
232232
if (image != null) {
233+
setImage(null);
233234
setImage(image);
234235
}
235236
}

0 commit comments

Comments
 (0)