After the craft framework port (#8160):
- Test modules gated by cfg(all(test, not(wasm32))) weren't recognised as tests by
clippy, so their expect/panic calls counted as production code; gate them with
cfg(test) and cfg(not(wasm32)) separately.
- Remove dead test helpers, restore the Windows manifest tests the port dropped,
and fix the remaining lints (redundant clones and casts, unused imports).
- Page Setup on Windows called a main_window_handle() that doesn't exist; parent the
driver dialog to the active window again, as before the port.
* refactor(render): route PDF reading and rendering through shared craft-pdf (storytold/craft-libs#778)
* fix(render): convert u32 raster dimensions to usize for Pixels::zeroed
* fix(render): remove unused hayro_syntax imports in inspect
* fix(render): let shared raster dimensions reject rounded over-budget sizes before allocation
* chore(pdf): repin craft-libs to #2497 and align tests with shared contract
* fix(render): align remaining 8 tests and OutputLimit error with craft-libs contract
* docs(attribution): update ATTRIBUTION.md for shared hayro* dependencies
* docs(attribution): include adobe_data suffix for hayro-cmap in ATTRIBUTION.md
* docs(attribution): sync ATTRIBUTION.md with cargo xtask assets --write
* docs(licenses): update NOTICE hash and hayro-interpret asset licences in LICENSES.toml
---------
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
- pdf-shell-w14: written by an agent
- pdf-shell-w14: finished by an agent
- pdf-shell-w14: finished by an agent
- pdf-shell-w14: review fixes (review-1)
The first window used to spend the launcher's token as soon as it was chosen.
On X11, `UnownedWindow::new` can return an error before it reaches
`remove_activation_token`, so a retry got no token and the launcher's busy
cursor stayed until its timeout (CodeRabbit on #3972).
The token is now reserved while the window is built. Each backend marks it
spent just before handing it back (Wayland `xdg_activation.activate`, X11
`remove_activation_token`), a created window commits it, and a window that
fails earlier releases it for the next one. A window created while the token
is held neither takes nor releases it.
A launcher with StartupNotify=true passes an activation token in
XDG_ACTIVATION_TOKEN (Wayland) or DESKTOP_STARTUP_ID (X11) and shows a
busy cursor until a window hands it back. winit hands back only a token
given through with_activation_token, and eframe never gives one, so GNOME
kept the busy cursor for 15 seconds after PdfCraft's window appeared, and
a Wayland window opened without keyboard focus.
Vendored winit patch 14: the first window created without a token takes
the environment's. Later windows don't reuse the spent token; an empty or
oversized (over 1,024 bytes) token is ignored, since on X11 an oversized
one would fail window creation. The variable stays in the environment:
removing it while other threads may read it is unsound.
Tests: startup_token's policy tests in the vendored crate (three fail with
the policy reverted) and apps/pdfcraft/tests/winit_startup_token.rs, which
keeps the patch in the build (fails with the Window::new wiring reverted).
Pinning craft-pdf to the #1852 merge SHA also picked up d74e60b2, which
makes create() and set_encryption() refuse RC4-40 and RC4-128. Tests,
helpers and the protect example that still write those schemes now use
create_legacy and set_encryption_legacy. Edit::Protect does the same
when the chosen algorithm is legacy, so a file that must stay readable
by a reader without AES can still be written.
* chore: cut over image, png, tiff, and zune-jpeg to craft-image-codecs
* chore: cut over xfa XML parsing from roxmltree to craft-xml
* chore: cut over export DOCX and PPTX packaging to craft-opc and craft-xml
* style: cargo fmt
* Print: list printers without asking drivers; ask only about the one picked (#2192)
On Windows, craft-print's printers() reads every driver's capabilities to
report two-sided support. Windows takes about 48 s to give up on a printer
it can't reach, such as a WSD printer on another network, so the Print
dialog waited for each one before it listed anything (#2192).
The dialog now lists printers from craft-print's printer_queues(), which
asks no driver, and asks two_sided() about the printer the user picks, on
a background thread (PdfCraftApp::two_sided_source, set by the desktop app
like printer_source). Each answer is kept for the session, so a printer is
asked about at most once, and one nobody picks is never waited on. The
"doesn't take two-sided settings" note shows once the answer arrives.
The automation printers tool still uses printers(), so it keeps reporting
two_sided.
Needs the craft-libs change that adds craft_print::two_sided.
* Build: take craft-print from storytold/craft-libs#133
Pins craft-print to the head of storytold/craft-libs#133 (b6a3b87), which
adds craft_print::two_sided as one commit on craft-libs main at 5ee809f.
craft-print is otherwise unchanged from 7ee35a9, the rev main pins now; the
other craft-libs crates stay where they are. Fetched through the
storytold/craft-libs URL, so cargo-deny's allow-git is unchanged. To be
replaced by the merge commit once #133 lands.
* Print: run at most four two-sided reads at once
A driver Windows can't reach holds its two-sided read for about 48 s, so
picking printer after printer started a thread for each. At most four now
run at once; past that, the printer picked is asked once a read finishes.
Tests: hanging reads are capped and the picked printer is asked after one
finishes; a list that already says whether a driver takes two-sided
settings is used as it is, with no driver asked.
* Repin craft-print to craft-libs main, where #133 merged (b6b8a55b)
---------
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>