From 10745e48a228e8b15b36b5cab106459ad5458155 Mon Sep 17 00:00:00 2001 From: Shahzaib Ibrahim Date: Thu, 13 Feb 2025 11:38:40 +0100 Subject: [PATCH] Shell Icon disappears on zoom change Setting an image for a shell on top left disappears on monitor change in monitor specific scaling mode. The reason behind it was that the image was being disposed by setImages method called after setImage in handleDPIChanged. The setImages method should not have been called if there are no images present in the array. The solution is to check whether we have any images in the in the array with the null check. --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java index 095b28c2e48..0ff48934a2f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java @@ -1699,7 +1699,7 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac } Image[] images = decorations.getImages(); - if (images != null) { + if (images != null && images.length > 0) { decorations.setImages(images); }