Skip to content

jcombs-pointblue/DesignerMacXmlFix

Repository files navigation

DesignerMacXmlFix

A one-instruction bytecode patch that restores text selection in OpenText (NetIQ) Identity Manager Designer 4.10.x on macOS Tahoe 26.1+.

Without this patch, Designer's GCV "Edit XML…" dialog, the DirXML Policy editor's "XML Source" tab, the standard Java editor, and every other multi-line text widget across Designer show broken visual selection highlighting: Cmd-A, drag-select across lines, and shift-arrow appear to do nothing. The selection state is actually correct (try Cmd-A then Delete — the whole document goes); only the highlight rendering clips to one line.

Root cause

This is not a Designer bug. It's an upstream Eclipse SWT bug.

org.eclipse.swt.graphics.TextLayout.draw() paints the trailing FULL_SELECTION fill rect with a width of 0x7fffffff (≈ 2.15e9). On macOS Tahoe 26.1+, NSBezierPath.appendBezierPathWithRect() silently rejects rect widths that huge, so the trailing fill never paints. Combined with how StyledText draws multi-line selections, this manifests as highlights collapsing to single-line visual scope while selection state remains correct.

Upstream fix:

  • Eclipse SWT issue #2621
  • Eclipse SWT PR #2694 (merged 2025-10-29, milestone 4.38 M3)

The upstream fix replaces 0x7fffffff with OS.MAX_TEXT_CONTAINER_SIZE (5,000,000). Designer ships SWT 3.106.2 (Nov 2017) which contains the identical buggy line. This project applies the same one-instruction change to the Designer-bundled jar via ASM.

What gets patched

Item Value
Jar /Applications/Designer/plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.106.2.v20171129-0543.jar
Class org/eclipse/swt/graphics/TextLayout
Method draw(GC, int, int, int, int, Color, Color, int)V
Instruction one ldc2_w of double 2.147483647E95_000_000.0

The double constant 2.147483647E9 also appears in org/eclipse/swt/widgets/Display for an unrelated 32-bit overflow normalization loop. The patcher targets TextLayout only.

Build

./build.sh

Outputs dist/swt.cocoa.macosx.x86_64.jar (a drop-in replacement for the Designer-bundled fragment). Requires JDK 8 (zulu-8 auto-detected from ~/Library/Java or /Library/Java, or override via JAVA_HOME_8).

The vendored pristine jar at lib/swt.cocoa.macosx.x86_64.original.jar is sha-checked against the live install to catch stale vendors after a Designer upgrade.

Install

./install.sh
  • Backs up the original to <jar>.bak (idempotent — preserved on subsequent runs).
  • Copies the patched jar into place.
  • Wipes the Equinox bundle cache (configuration/org.eclipse.osgi/*) so the new bytecode is read on next launch.
  • Refuses to run while Designer is running.

Verify

After ./install.sh, launch Designer and:

  1. Open any Identity Vault project. Right-click a driver → Properties → Global Configuration Values → Edit XML…
  2. Cmd-A should now highlight the entire XML, not just one line.
  3. Click-drag across lines should highlight correctly.
  4. Shift-arrow up/down should extend selection visually.

If the dialog still appears broken, check configuration/*.log for any Equinox refusal to load the unsigned fragment, and confirm ./uninstall.sh then ./install.sh again with Designer quit.

Uninstall

./uninstall.sh

Restores the pristine jar from <jar>.bak. Idempotent.

Signing

The Eclipse-distributed SWT fragment is signed (META-INF/ECLIPSE_.SF, ECLIPSE_.RSA, per-entry SHA-256 digests). Modifying any class invalidates that signature, so the patcher:

  • Drops the .SF / .RSA / .DSA / .EC blocks.
  • Strips signer-added *-Digest-* headers from the main manifest.
  • Drops per-entry sections from MANIFEST.MF (their only content in a signed Eclipse fragment is the per-entry digest).

Equinox loads unsigned local fragments under plugins/ with at most a log warning — no enforcement on the Designer plugin path.

Compatibility

  • macOS Tahoe 26.1+: fixes the bug.
  • macOS Sequoia 15.x and earlier: no behaviour change (the replacement value 5_000_000 is still effectively "wider than any reasonable display", so the trailing fill still extends past the visible viewport).
  • Apple Silicon: Designer runs x86-64 under Rosetta, so the cocoa.macosx.x86_64 fragment is correct. If a future Designer release ships an aarch64 fragment, the same patch needs to be re-applied against that jar.

Relationship to designer-fast-import

This is not part of the designer-fast-import LDAP/NDAP bulk-read cache patch and must not be folded into the fast-import bundle. The two patches target different jars and address different bugs. Install or uninstall them independently.

About

One-instruction bytecode patch backporting Eclipse SWT PR #2694 into NetIQ / OpenText Identity Manager Designer 4.10.x — fixes broken text-selection highlighting on macOS Tahoe 26.1+.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors