The pen that took the Wintab readings now reads the latest packet of its
own cursor whenever that cursor is still near the context, instead of
only when it is the one cursor read. Another tablet's airbrush moving
while the pen is held still no longer drops the pen's wheel.
- Each pen's end is kept by its pointer id, so only the same pen turning over
starts the readings afresh; another pen's message with the other end does not.
- A cursor whose WTInfoW query failed is asked again 2 s of the message clock
later, and only a cursor the driver describes without a wheel is cached as
having none.
- Whether the app is active is asked again right before WTOpenW, after the
close and WTInfoW calls before it.
- docs/target-app-parity.md: a pen first reads the wheel from a packet within
200 ms of its message, then holds the readings until they start afresh.
The Paintbrush with a brush whose Size or Width is on Stylus Wheel with
a range the wheel can change, or the Eraser with a value on Stylus Wheel
and a variation above 0, uses the wheel. The app asks the active tool
(Tool::reads_wheel) once a frame and tells the host when the answer
changes (Services::stylus_wheel). Until a tool uses the wheel, a pen
message loads no Wintab32.dll, installs no hook, subclasses no window
and opens no context; when it stops, the context closes.
Linux nightly packaging by @dylanmtaylor, with the per-app Nightly flavor commits stacked on his branch.
gate test shard 1/5 (and the Sonar scan that reads its coverage) fails on crates/ui-egui/src/doc_windows/tests.rs `a_document_made_current_in_presentation_mode_comes_to_the_front_after_it`, which main fails too (CI run 45581083304); this PR touches no ui-egui code.
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
The Safe Mode choice after a stopped launch moves to main's dialog host and keeps listing every
plug-in that was loading: one name in the sentence, or the list with "Disable Listed Plug-ins and
Continue". Automation requests wait in the queue while plug-ins load, and one past its deadline is
answered as expired. File > Open and opening a file still wait for the plug-ins still loading.
A start ended before its first frame leaves its adapter recorded as
crashed in graphics-start.json, and the next start leaves that adapter
out. A start ended from outside (a --control session terminated early)
looks the same as a crash in the driver, so on a machine with one GPU,
such as an Apple Silicon Mac, the next start had no adapter left and
failed with "no graphics adapter can show the window".
The selector now tries the adapters that crashed an earlier start
again, with a warning in the log, when leaving them out would leave
none. Adapters a restart left out after they failed in this run of the
app stay left out, and with another adapter to try, the one that
crashed is still left out.
Fixes#9183
Once a pen has read an airbrush cursor's wheel, a recent packet of
another tablet's airbrush no longer gives that pen its wheel. The pen
reads the other cursor only after the readings start afresh.
The port's window looks closer to production's VectorCraft (0.18 and its source), and the app's live screenshots work again.
Icons
- The app's icon and cursor sets are registered when the app is made (`VectorcraftApp::new`), so the web build, the tests and offscreen renders draw them, as the desktop app does.
- Each tool command carries its tool's icon, so the tool rail and its flyouts draw the tools instead of the "more" glyph.
- The hint bar's help icon is drawn (`dc-help`, a question mark in a circle, which no set had).
Screenshots
- `ui.screenshot` captures are issued from the app's kept UI passes, and the app repaints until they are issued; before, every capture timed out after 8 s. New test `tests::automation::a_screenshot_is_issued_by_the_apps_frames_and_written`.
Title bar and tabs
- Home is a bare icon toggle without the options-bar rule; the window title shows only beside the macOS menu bar.
- The Discord button is a soft neutral button with a border.
- Document tabs drop their own `*`, since the strip's modified mark shows it.
Properties panel
- Section headings in label text; form labels with colons beside fields that keep their own width; the Character section keeps its panel layout.
- Rotate and Shear show their icon and keep their own width; the Constrain Pie Angle link sits beside the pie angle fields.
Buttons and the Contextual Task Bar
- Push buttons have production's 4-point corners (the app's sizes set `radius.button`), so they are as narrow as production's.
- The task bar's actions are outlined push buttons.
Artboards panel
- Select All's keys select every artboard only while the list is drawn with the keys.
Checks: `vectorcraft-ui-egui` lib tests 3772 passed, 3 failed. The 3 failures also fail on `main` and need a newer craft-libs (Save for Web palette, two Select All tests). Clippy (`vectorcraft-ui-egui`, `vectorcraft`, all targets, `-D warnings`) and `cargo fmt --check` are clean.
VectorCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (`next`; the framework side is storytold/craft-libs#2809), as PhotoCraft's did. The app keeps its engine, document model, file formats, commands and automation; its windows, panels, bars, dialogs and canvas are now built and driven by the framework: shell, docking and panels, hosted dialogs, keyboard, focus, IME and pointer routing, and theme tokens.
About 264,000 lines of VectorCraft's own egui UI code are removed and about 154,000 added. craft-libs is pinned at bf62d509f (in `next`), the egui fork at f5025284.
Tests that drove the old UI were rewritten against the port where only their premise changed, with their assertions kept. The UI tests still failing at merge, and their follow-ups, are listed in the pull request.
* Type: NHM Writer's legacy Tamil keymaps (symbol fonts) type their characters on Windows
NHM Writer's legacy Tamil keymaps (e.g. "Tamil Phonetic StmzhRgb" for
SR-Tamil fonts) post each byte as a WM_CHAR of U+F000 + byte, Windows'
symbol-font convention. egui-winit's is_printable_char rejects the
Private Use Area, so the Type tool got nothing (only the tool's
Backspace presses arrived).
windows_symbol_chars notes U+F020..=U+F0FF characters in winit's message
hook, in order with Backspace presses, and hands them to the frame as
Event::Text, unchanged (symbol fonts map exactly these code points),
each before the Backspace press that followed it. Unchanged matters:
as Latin-1, byte 0xAD (SR-Tamil's ஷ) would become U+00AD, a soft hyphen
the text engine never draws.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SY4wMcmnVnfGn5yC3dDic2
* Contributors: add my display name (HASAN CGI)
* Type: symbol-font characters keep their order among all typed text and keys; no new unsafe
Review of #6930: windows_symbol_chars now notes every character and key
press the window gets, not only Backspace, and places each symbol-font
character before the text or key press that followed it (a symbol then
an ordinary character, or a symbol then a navigation key, no longer
swap). It no longer has a message hook of its own: windows_alt_codes's
existing msg_hook, which already reads each MSG, hands it the message,
so the module has no unsafe code. Tests cover symbol/ordinary-text and
symbol/navigation sequences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SY4wMcmnVnfGn5yC3dDic2
* Revert "Contributors: add my display name (HASAN CGI)"
This reverts commit 78ff9cbb2a.
* Type: rustfmt order for mod windows_symbol_chars
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- A fit made while a floating window's display has not answered keeps
counting from the density the window was last shown at, so Actual
Size and the zoom field no longer fall back to 96 points to an inch
meanwhile.
- A view that still fits its floating window keeps fitting it after a
move to a display of another density: the fit kept for the window
takes the settled zoom.
- The plausible range of a measured display applies to its pixels per
inch, before the display scale divides them into points. A
1920 x 1080 display of 527 x 296 mm at scale 4 now measures about
23 points to an inch instead of falling back to 96, and Actual Size
takes any finite, positive point density the host measured.
- View > Set Zoom, Zoom In and Zoom Out, the wheel and the Zoom tool
clear the zoom a fit gave the view, so a percentage that equals the
last fit's zoom keeps its percentage at the first reading.
- The Actual Size and preference descriptions say that a size no
display has also counts 96 points to an inch.
A fit made in the main window while its display was being read counted
from 96 points to an inch until the reading arrived, so the zoom field,
the tab title and the zoom stops counted from a different density than
the window's other views. The fit now counts from the last reading, and
the reading, when it comes, keeps the fit's zoom, also when the views are
settled again before it arrives.
An app that draws no frames now still reads the displays again a minute
after the last reading: it asks for a frame then.
Tests now cover Actual Size after a fit that gave the same zoom, a
Navigator thumbnail click, and a floating OS window's display readings
(first display, a move, off every display, a fit, and docking back).
docs/mcp.md now states which views keep their zoom at the first reading,
that X11 and Wayland are read on Linux only, that headless sessions and
the CLI count 96 points to an inch, and that the preference also applies
in Pixel Preview. The progress line names the two rules that differ from
the help page.
Preferences › General › Display Print Size at 100% Zoom is now on by
default, also for saved preferences that predate the key; a saved
choice to turn it off stays off.
A document floating in an OS window of its own counts 100% from the
display that shows that window. A move of the main window leaves the
zoom of floating windows alone, and a window that moves to a display of
another density keeps its zoom percentage.
The desktop app lists the displays once a second while the preference
is on and reads their physical sizes on a background thread when the
list changes; the UI thread does not wait for the X11 or Wayland
queries. RandR is asked for its version before the CRTC and output
queries. A reading that fails is tried again after 10 seconds, and the
displays are read again a minute after the last reading, so a display
replaced by one that lists the same gets its own size.
The Navigator's zoom field, slider and thumbnail clicks count the zoom
from Actual Size, as the status bar's zoom field does; before, a click
on the thumbnail with the preference on changed the zoom. ui.inspect
gives screenPpi and printPpi. The preference's description is updated
in every catalog.
With Preferences › General › Display Print Size at 100% Zoom on, 100%
took 96 screen points to an inch on every display, so a ruler held to
the screen measured more or less than the document said on any display
of another density. The desktop app now measures the density of the
display that shows the main window from the physical size the system
reports (CGDisplayScreenSize on macOS, the monitor's raw DPI on
Windows, the RandR output's millimeters on X11, the wl_output geometry
on Wayland), and measures it again when the window moves to another
display, where every document window keeps its zoom percentage so the
art keeps its physical size. Actual Size, the zoom field, the zoom
stops and the tab titles count 100% from that density. Where the
system reports no size, or a size no display has (zero, an aspect
ratio given as the size, or axes that disagree), an inch stays 96
points, as on the web.
Zoom stepping takes the density from the app instead of a
process-wide flag, and the last zoom stop in each direction stays in
the zoom range.
At launch the desktop app loaded every stored plug-in and every module in
the Additional Plug-ins Folder on the UI thread before the window
appeared, one after the other. A slow or panicking module held up or
ended startup.
- crates/plugins/src/loader.rs (new): `Loads` runs load jobs on up to
four threads. Each job runs inside `catch_unwind`; a panic or a load
that takes 10 s or longer fails that job alone, and the others go on.
Outcomes come back in job order.
- registry::FolderLoad and store::StoredLoad list in one step, load on
the workers and install in file-name order. A module whose id was
installed or removed in another window while it loaded is skipped.
- The desktop app loads in the background only during launch; frames
install the finished loads. Plug-in commands, commands that edit,
exports, control requests and files opened at launch wait for the
loads first; view commands and queries do not.
- The launch marker names every plug-in still loading, not only the
oldest. After a launch that stopped during the loads, the Safe Mode
choice lists all of them, and Disable Listed Plug-ins and Continue
turns them all off. `plugin.safeMode` adds `pendingItems`. A module
whose load panicked is no longer named.
Docs: docs/plugins.md, docs/mcp.md.
grants.json now holds {"version": 1, "grants": [...], "mac": "..."}, where
mac is an HMAC-SHA-256 of the grants and of the plug-in folder, made with a
random 32-byte key kept in the system key store: the Keychain on macOS,
Credential Manager on Windows, the Secret Service on Linux and the BSDs. The
MAC is compared in constant time. A file without a valid MAC for its folder
(an edited or added grant, a removed or changed MAC, a file copied from
another folder) grants nothing, and its plug-ins ask for approval again.
This changes the default for existing files: a grants.json written by an
earlier version is a plain list without a MAC, so its plug-ins ask once
more, and the next approval replaces it with a signed file.
When the key store can't be reached, an approval lasts for the session
only, nothing claims to persist, and the existing file is left as it is.
The first key is made under a per-user lock and read back, so processes
that approve their first plug-in at the same time keep one key. The web
build keeps no grants file.
New native-only dependencies of vectorcraft-engine: hmac, sha2, getrandom
and keyring (all MIT OR Apache-2.0).
- An open that leaves no context (a failed `WTInfoW` or `WTOpenW`, or a
window procedure that could not be put in front) is tried again for the
same window by a pen message 2 s or more later (`RETRY_MS`), instead of
only after the pen moves to another window. An open context is kept as
before.
- Windows sends `WM_POINTERLEAVE` to the window procedure, so winit's
message hook does not see it. A `WH_CALLWNDPROC` hook on the UI thread
now hands a sent `WM_POINTERENTER` or `WM_POINTERLEAVE` to the stylus
code, and the wheel pen's leaving starts the readings afresh. A leave
that comes while the readings are in use takes effect at the next
Wintab or pen message. Until the hook is installed no context opens.
- The context closes when another app becomes the active one
(`WM_ACTIVATEAPP`, seen through the same hook), and no pen message
opens one while the foreground window belongs to another thread, so the
context does not stay in front of another app's context in the driver's
overlap order.
- A close notice and an information change in one batch now both
count: the handle the driver closed is dropped without WTClose, and
each cursor's wheel range is read again.
- The window procedure that notes the driver's notices is put in front
of the window's own before a context is opened. When it cannot be,
no context is opened for that window.
- A packet that reports the context's queue overflowed (TPS_QUEUE_ERR)
starts every reading afresh, not only its own cursor's.
- The first pen whose pointer message comes within 200 ms of an
airbrush packet takes the readings. Another pen's messages read no
wheel until they start afresh, and the taking pen's leaving starts
them afresh.
The tablet driver sends WT_CTXCLOSE and WT_INFOCHANGE to the window
procedure, and a sent message does not pass winit's message hook, so a
context the driver closed kept its handle and the wheel stopped reading.
The context's window now gets a window procedure in front of its own that
notes both notices. The next Wintab or pen message drops a closed context
or closes and reopens it after an information change, forgetting the
cached cursor ranges. A notice the reader causes by closing its own
context does not drop a later context with the same handle value.
A packet that WTPacket cannot read now starts the readings afresh, so a
pen message no longer takes a wheel value that may be stale.
Only the pen whose message last read the wheel clears the readings when
it leaves the window or detection range or its press is canceled; a
touch or another pen leaving keeps them.
Pointer messages carry no field for an airbrush pen's finger wheel, so a
brush set to Stylus Wheel drew the half-way value on Windows. The new
windows_wintab module reads the wheel from the tablet driver's Wintab
interface as the tangential pressure of a cursor the driver reports as an
airbrush, placed within its device's DVC_TPRESSURE range.
- Wintab32.dll is loaded at run time from the system directory only
(LoadLibraryExW with LOAD_LIBRARY_SEARCH_SYSTEM32). Without it, without
one of its exports, or when a call fails, Windows pens read no wheel and
draw as before.
- The context is opened from the driver's default context with packet
messages on and CXO_SYSTEM and CXO_PEN off, so it moves no cursor and
makes no press. It follows the top-level window the pen is over.
- WTInfoW answers are size-checked against a null-buffer call and read
into a larger buffer; packets are read into a buffer larger than any
packet and decoded from the fields the context asked for; a value
outside the axis range reads as no wheel.
- Pointer messages keep the pressure, end, tilt and rotation. A pen's
message takes the airbrush's last wheel since it came near, or, when
several cursors were read, the one whose latest packet came within
200 ms of the message, and none when more than one or none did. 0
counts as no wheel until the pen reports another value, as on macOS,
and the readings start afresh on proximity, a cursor change, the other
end, a canceled press and leaving the window.
Docs: docs/mcp.md, docs/target-app-parity.md.
When the work area is smaller than the smallest window (800 x 500
points), `place` fits the restored window to it, but the native
minimum inner size from `native_options` stayed at 800 x 500, so the
system kept the window bigger than the work area. `restore` now lowers
the minimum to the fitted size in each dimension where it is smaller,
and keeps the normal minimum where the work area has room for it.
The monitor list for floating panels now carries each monitor's work
area: rcWork from GetMonitorInfo on Windows, and visibleFrame on macOS,
turned into the top-left origin and physical pixels of the monitor's
rect. The work area is converted to points with the same scale and zoom
as the rect, and craft-ui uses it to decide whether a reopened panel's
title bar can be grabbed and where to move it. A work area with no width
or height is left out.
Restoring the main window now keeps it inside its monitor's work area
too, so a window saved at the top edge of a monitor with a taskbar along
its top opens below the taskbar, and a window taller or wider than the
work area is made to fit it, with room for a system title bar and
border when the window has them.
On Windows the panel list stays empty when the monitors have different
scale factors, as before, and a build without the wgpu feature reads no
work areas. Linux and the BSDs keep the whole monitor rect.