Commit 1bb3e71
fix: pass headless JVM flags so macOS does not show Dock icon
Objective: On macOS, every CLI run pops a Java icon in the Dock and
steals focus from the active window — so any batch or repeated PDF
conversion turns into a flickering, focus-thrashing experience.
Approach: Pass -Djava.awt.headless=true and -Dapple.awt.UIElement=true
as JVM args ahead of -jar at every spawn site (Node wrapper, Python
wrapper, scripts/run-cli.sh, npm export-options). The CLI never opens
a UI — it only manipulates BufferedImages and renders PDFBox pages off
screen — so headless is safe everywhere. apple.awt.UIElement is the
macOS-specific flag the launcher reads to skip Dock registration; it
is harmless on other OSes.
Evidence: Ran the built jar and the Node wrapper against a sample PDF
on macOS.
Before: every invocation surfaced a Java Dock icon and stole focus.
After (java -D... -jar): PDF processed, JSON written, no Dock icon.
After (Node convert() API): variant resolved successfully, no Dock icon.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent dc73cd6 commit 1bb3e71
4 files changed
Lines changed: 26 additions & 5 deletions
File tree
- node/opendataloader-pdf/src
- python/opendataloader-pdf/src/opendataloader_pdf
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments