From 92ae80e5f31b91aeedce4894df6d8dff04d6d66e 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 8778c0d26a2..50395fd5c0a 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 @@ -4517,9 +4517,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 bfe161cc67b..025253b0276 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 @@ -2291,9 +2291,7 @@ public static Selector getSelector (long value) { public static final int NSRoundLineJoinStyle = 1; 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 ea25420fec6..8e29470b678 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 43e73d710fb..a6490a86622 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;