From dff793a67fe82575745eb706bfda119f82515c64 Mon Sep 17 00:00:00 2001 From: "Klare, Heiko" Date: Tue, 10 Feb 2026 18:45:21 +0100 Subject: [PATCH] [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 https://github.com/eclipse-platform/eclipse.platform.swt/issues/3073 --- .../Eclipse SWT/common/org/eclipse/swt/widgets/Item.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Item.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Item.java index c4984ff3bcd..f76891011fe 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Item.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Item.java @@ -230,6 +230,7 @@ private void handleDPIChange(Event event) { // Refresh the image Image image = getImage(); if (image != null) { + setImage(null); setImage(image); } }