From 6bc59a32be65b91bdfdccaa84f28519f50f46b6b Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Sun, 12 Jul 2026 14:05:49 +0200 Subject: [PATCH] [Cocoa] Remove deprecated scroller part constants NSScrollerDecrementLine and NSScrollerIncrementLine are deprecated since macOS 10.14 without replacement, as scrollers do not have arrow buttons anymore since macOS 10.7. Remove the constants together with the dead switch cases in ScrollBar and Slider that handled hits on the no longer existing scroller arrows. Contributes to https://github.com/eclipse-platform/eclipse.platform.swt/issues/3214 Co-Authored-By: Claude Sonnet 5 --- .../swt/internal/cocoa/AppKitFull.bridgesupport.extras | 2 -- .../cocoa/org/eclipse/swt/internal/cocoa/OS.java | 2 -- .../cocoa/org/eclipse/swt/widgets/ScrollBar.java | 8 -------- .../Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java | 8 -------- 4 files changed, 20 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras index b43990cb1d..4970dbd0d9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras @@ -4504,9 +4504,7 @@ - - diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index 40c830f846..e9960e9e83 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -2293,9 +2293,7 @@ public static Selector getSelector (long value) { public static final int NSImageScaleNone = 2; public static final int NSScrollElasticityNone = 1; public static final int NSScrollWheel = 22; -public static final int NSScrollerDecrementLine = 4; public static final int NSScrollerDecrementPage = 1; -public static final int NSScrollerIncrementLine = 5; public static final int NSScrollerIncrementPage = 3; public static final int NSScrollerKnob = 2; public static final int NSScrollerKnobSlot = 6; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java index ea25420fec..8e29470b67 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java @@ -481,18 +481,10 @@ void sendSelection () { int hitPart = (int)((NSScroller)view).testPart(point); Event event = new Event(); switch (hitPart) { - case OS.NSScrollerDecrementLine: - value -= increment; - event.detail = SWT.ARROW_UP; - break; case OS.NSScrollerDecrementPage: value -= pageIncrement; event.detail = SWT.PAGE_UP; break; - case OS.NSScrollerIncrementLine: - value += increment; - event.detail = SWT.ARROW_DOWN; - break; case OS.NSScrollerIncrementPage: value += pageIncrement; event.detail = SWT.PAGE_DOWN; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java index 43e73d710f..a6490a8662 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java @@ -333,18 +333,10 @@ void sendSelection () { int hitPart = (int)((NSScroller)view).hitPart(); int value = getSelection (); switch (hitPart) { - case OS.NSScrollerDecrementLine: - event.detail = SWT.ARROW_UP; - value -= increment; - break; case OS.NSScrollerDecrementPage: value -= pageIncrement; event.detail = SWT.PAGE_UP; break; - case OS.NSScrollerIncrementLine: - value += increment; - event.detail = SWT.ARROW_DOWN; - break; case OS.NSScrollerIncrementPage: value += pageIncrement; event.detail = SWT.PAGE_DOWN;