Skip to content

macOS: open presentations from Finder, Open With and the Dock (#138, #347) - #432

Merged
skylartaylor merged 2 commits into
storytold:mainfrom
Lexx143:fix/macos-finder-open
Oct 21, 2026
Merged

skylartaylor merged 2 commits into
storytold:mainfrom
Lexx143:fix/macos-finder-open

Conversation

@Lexx143

@Lexx143 Lexx143 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #138, fixes #347.

On macOS, DeckCraft set as the default app for .pptx launched on a double-click and then showed "DeckCraft cannot open files in the Office Open XML presentation format": Info.plist had no CFBundleDocumentTypes, and the file arrives as a kAEOpenDocuments Apple event that winit 0.30 doesn't handle.

This builds on #311 by @mendy-cohen, whose commit I kept as is (the same fmv-macos-events approach as GridCraft, -psn_ ignored), and adds what the packaging rules ask for:

  • .potx and .ppsx too. The Windows installer (deckcraft.wxs) and the Linux desktop file already offer DeckCraft for .deckcraft, .pptx, .potx and .ppsx; the macOS plist now declares the same four (org.openxmlformats.presentationml.template and .slideshow imported like .presentation). The pptx reader takes all three.
  • A test (apps/deckcraft/src/main.rs): reads the three packaging files and fails when the sets drift apart, and checks every document type names its content type (Finder's "Change All" needs it).
  • Progress log row in ROADMAP.md.

PowerPoint stays the default until the user picks DeckCraft (LSHandlerRank Alternate).

Testing

  • macOS 26.5.2, Apple silicon, local build with packaging/macos/package.sh --arch aarch64 (ad-hoc signature) installed to /Applications, DeckCraft chosen as the default app for .pptx:
    • open "Проверка Finder (1).pptx" (what a Finder double-click sends) launches DeckCraft with the deck open: document.inspect over the control port shows the file's path and both slides, where 0.5.0 showed the "cannot open files in the Office Open XML presentation format" alert;
    • open -a DeckCraft with a .potx, a .ppsx and a .deckcraft while DeckCraft is running: each opens in the running app;
    • quit app "DeckCraft" from AppleScript quits it (the Event::Quit path);
    • --version still prints and exits; the log has no errors or warnings.
  • cargo test -p deckcraft (20 passed, the new test included), cargo clippy -p deckcraft --all-targets -- -D warnings, cargo fmt --check, plutil -lint on the rendered plist.

The other open fixes for the same bug: #68, #180, #186, #311.

🤖 Generated with Claude Code

anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…ting to the system region (storytold#463)

* Issue storytold#432: global Units preference (mm, cm, in, pt), defaulting to the system region

Preferences ▸ Documents and view ▸ Units sets the unit for page sizes
(Document Properties, Print), Header & Footer margins, the start of Set
Page Boxes and the Measure tool on pages without a viewport scale. On
first start it follows the system region: AppleMeasurementUnits on macOS,
Region ▸ Measurement system (iMeasure) on Windows, then LC_ALL /
LC_MEASUREMENT / LANG; inches for US, LR and MM, millimetres elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Issue storytold#432: macOS falls back to AppleLocale when the measurement system was never set

AppleMeasurementUnits only exists in the global domain once someone changed
Measurement system in System Settings, and apps started from the Finder get no
LANG, so a German Mac with untouched settings landed on inches. The region of
AppleLocale (always present) decides next; AppleMeasurementUnits still wins.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REz7wTfQgnopyvN9eQJJVu

* Issue storytold#432: Units labels in the Arabic and Italian catalogs new on main

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REz7wTfQgnopyvN9eQJJVu

* Issue storytold#432: the Print dialog's PDF page size follows the Units preference

Main's new "PDF page: {w} × {h} in" label was always in inches. It now uses
the preferred unit like the sheet size next to it; each catalog keeps its
wording with the size in place of the inch values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tristan von Kries <tristan@MacBook-Pro-von-Tristan.local>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
mendy-cohen and others added 2 commits October 17, 2026 12:17
The macOS bundle declared the .deckcraft and .pptx types but listed no
CFBundleDocumentTypes, so DeckCraft never appeared under Open With and
couldn't be made the default app for presentations. Finder opens also
arrive as a kAEOpenDocuments Apple event, not argv, which winit doesn't
handle, so a double-clicked file wouldn't have loaded anyway.

- Info.plist.in: document types for DeckCraft Presentation (Owner) and
  PowerPoint Presentation (Alternate, so PowerPoint/Keynote stay
  preferred unless the user picks DeckCraft).
- apple_events.rs: register an open-documents handler with the pinned
  fmv-macos-events crate GridCraft already uses, and open the paths each
  frame; failures show in the status bar.
- Ignore the -psn_ argument older macOS passes on a Finder launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WxAm8VMKHa5w6kwkjBaT3D
…, log the change

Windows (deckcraft.wxs) and Linux (the desktop file) already offer DeckCraft for .deckcraft,
.pptx, .potx and .ppsx; the macOS Info.plist now declares the same four, so a template or a
slide show opens from Finder as well. A test in apps/deckcraft reads the three packaging files
and fails when they drift apart, and checks every document type names its content type (Finder's
"Change All" needs it). Progress log row for storytold#138 and storytold#347.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Lexx143
Lexx143 force-pushed the fix/macos-finder-open branch from b3aa24e to 9632162 Compare October 17, 2026 11:00

@skylartaylor skylartaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge. The document declarations cover the same four formats as the other desktop packages, and the pinned macOS adapter is registered before the event loop, retained for its lifetime, and wakes egui when another event arrives. The packaging and launch-argument regression tests cover the missing declarations and Finder's legacy argument.

I checked this head merged into current main (63831cd), without the follow-up change applied. A temporary macOS bundle passed cold PPTX opening, later PPTX/native/POTX/PPSX opens, invalid-file handling with existing documents retained, and Apple-event quit. Formatting, clippy, PDF dependency checks, assets, layering and WebAssembly checks pass. The remaining workspace tests pass with the unchanged intermittent a_line_that_is_not_a_request_closes_the_connection test excluded; that test also failed in earlier local runs. The fork's hosted workflows have now been approved and are running.

No blocking code findings. I'll follow this with a small change to call the newer open_from_system path, so Finder-opened .ppsx files start their slideshow just as command-line opens do, with regression tests. Thanks for retaining the original work from #311.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants