From 8c802c5710ac1352058bbfc63fff0f21838c6e57 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Sun, 31 May 2026 21:28:48 +0200 Subject: [PATCH] [Win32] Partially revert unnecessary creation of GC operations The GC's `getClipping()` operation stores region handles representing the clipping region (potentially at different zooms) that is combined with the passed region object. The handles for that passed region object are created on demand, so that immediate disposal of the clipping region handle leads to failures when creating the handle for the passed region later on. This change reverts c6bf2e93607b64fa3670bfa63592c96c2919aa36 that introduced the immediate disposal of GC operations to avoid that the clipping handles are not available. --- .../Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java index 75889472a5..b6c222ac29 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java @@ -6112,13 +6112,9 @@ int getZoom() { } private void storeAndApplyOperationForExistingHandle(Operation operation) { + removePreviousOperationIfSupercededBy(operation); + operations.add(operation); operation.apply(); - if (data.reapplicable) { - removePreviousOperationIfSupercededBy(operation); - operations.add(operation); - } else { - operation.disposeAll(); - } } private void removePreviousOperationIfSupercededBy(Operation operation) {