Commit Graph
448 Commits
Author SHA1 Message Date
BFlat c4147826a3 Merge pull request #7353 from dotCooCoo/fix/i18n-adjacent-placeholders
i18n: messages with values side by side can be translated
2026-11-17 21:32:55 +07:00
Taha-Mahmoodi 92a2d2de71 Fix clippy on macOS with current stable: dead_code on Overrides::is_set, needless_range_loop in cut_edge
Overrides::is_set is only called from main under cfg(not(macos)), so it is allowed to be unused there (the repo's cfg_attr pattern). settle_cut_edges walks blended with iter_mut().enumerate() instead of indexing it.
2026-11-17 16:48:13 +04:30
dotCooCoo fe9cfa875c Color: Sample Color from Screen picks where the button was released
The Windows sampler read the pointer with GetCursorPos when it handled
WM_LBUTTONUP, so a pointer that moved after the release picked a
different pixel. It now takes the point from the release message's
lParam, a signed client point, and converts it to screen coordinates.
lParam holds each coordinate in 16 bits, so on a virtual screen wider
or taller than 32,767 pixels the high bits come from the message's own
pointer position (MSG.pt).
2026-11-16 00:18:50 -08:00
dotCooCoo 388044db13 Color: Sample Color from Screen works on Windows
Windows had no screen color sampler, so the Color Picker's eyedropper
button was gray and ui.sampleScreenColor returned an error there.

The new sampler copies the virtual screen (every monitor, including
ones at negative coordinates and at other display scales) and covers it
with a borderless topmost window that shows the copy under a crosshair.
A left click picks the copied pixel, read as sRGB. Escape, a click of
another mouse button, Alt+F4 or switching to another window cancels.
The window runs on its own thread, so the app keeps drawing, and the
copy's size is checked before it is allocated.

Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md
and the ui.sampleScreenColor params text.
2026-11-15 23:15:43 -08:00
dotCooCoo bcab943669 Merge main into fix/i18n-adjacent-placeholders 2026-11-15 16:06:09 -08:00
BFlat bf7fefd89e Merge pull request #7954 from dotCooCoo/feat/file-info-templates
File Info: the menu saves, imports and lists metadata templates
2026-11-16 06:55:33 +07:00
BFlat e3f8d8abc6 Merge pull request #7961 from dotCooCoo/fix/clipboard-file-lists-formats
Clipboard: paste checks the size of another app's data before copying it
2026-11-16 06:54:09 +07:00
BFlat 5ecb2cda86 Merge pull request #7926 from dotCooCoo/feat/present-mode-overrides
Graphics: --present-mode and --frame-latency set how the window presents frames
2026-11-16 04:30:17 +07:00
dotCooCoo f66aa65083 Clipboard: Windows text is bounded before it is converted, and each bitmap format has its own limit
The size of a CF_UNICODETEXT block is checked against the most UTF-8 it
could come to (3 bytes a code unit), so the converted text is never
larger than the limit. CF_DIBV5 and CF_DIB are each copied when they
fit the limit, so a large first format that doesn't decode still
leaves the second to paste.
2026-11-15 12:06:56 -08:00
dotCooCoo 04b3123120 Clipboard: paste checks the size of another app's data before copying it
Paste takes at most 64 MiB of a format another app copied, VectorCraft's
existing limit for copied files, and reads the size before the copy:

- On Windows, each registered format, the CF_DIBV5 and CF_DIB bitmaps
  (together), CF_UNICODETEXT and the CF_HDROP file list. A larger format
  is skipped and the next one is tried.
- On macOS, each pasteboard type's data length is checked before it is
  copied.
- A copied file list of more than 1,024 files pastes no file, and no
  file in it is opened, on every platform, as the Linux text/uri-list
  reader already does. On Windows the CF_HDROP names are counted before
  they are read.
2026-11-15 11:41:45 -08:00
dotCooCoo a670cd1102 File Info: metadata templates save, import and list from the File Info menu
File Info's menu saves the fields as an XMP metadata template (into the
Metadata Templates folder next to the preferences, or any file), imports
one with a choice of three merges, lists the saved templates and opens
the folder. The import is one undo step and records nothing when no
field changes.

- file.info.saveTemplate writes the title (when it is not the
  document's name), author, author title, description, keywords,
  rating, copyright status, notice and URL that have a value.
- file.info.applyTemplate reads a file, a saved template or XMP text
  (at most 8 MB) and merges it: replace clears the fields first, keep
  takes each field the template has, append adds keywords and fills
  only empty fields. apply: false returns the merged fields without
  changing the document.
- file.info.templates lists the folder's .xmp files.
- A PDF or .ai also opens with the rating and author title its XMP
  packet gives.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-15 11:05:55 -08:00
dotCooCoo b0514228b0 Clipboard: Edit > Paste is enabled when the clipboard holds only copied files
On X11 and the Wayland data-control clipboard (through arboard), the
Paste menu check read only the clipboard's text, so a file manager copy
with no text left Edit > Paste disabled while the paste keys pasted the
first copied file that is art. After a text miss, the check now reads
the copied file list when the paste can take files, without opening a
file. Copied files already enabled Paste through the core Wayland check
and the Windows check. A paste of text alone does not read the list.
2026-11-15 10:56:12 -08:00
dotCooCoo 2238a00e43 Graphics: --present-mode and --frame-latency set how the window presents frames
--present-mode (fifo, autovsync or novsync) and --frame-latency (1 to 3),
or VECTORCRAFT_PRESENT_MODE and VECTORCRAFT_FRAME_LATENCY, change the
window surface for one launch. A flag overrides its variable, and a value
outside these stops the app with a message. The log records the surface
the app requests at startup. On Windows and Linux, a launch that sets
either one opens its files in a new window, as --new-instance does.
Without them the window keeps autovsync with one frame queued.
2026-11-15 10:54:08 -08:00
dotCooCoo 9c650ec9bb Merge main into fix/i18n-adjacent-placeholders 2026-11-14 12:31:21 -08:00
dotCooCoo 7985952ac5 Merge main into fix/i18n-adjacent-placeholders 2026-11-14 07:25:54 -08:00
dotCooCoo 32e90d5e2c Merge main into fix/paste-copied-file-size-limit 2026-11-14 07:18:49 -08:00
BFlat 564eee35d4 Merge pull request #7445 from dotCooCoo/fix/web-locks-monotonic-clock
Web: Data Recovery's lock snapshots use the monotonic clock
2026-11-14 21:50:49 +07:00
dotCooCoo e464b612cf Paste: a copied file over 64 MiB is skipped before it is read
Paste read a file copied in a file manager whole with std::fs::read,
with no size limit. It now checks the opened file's size against
MAX_BYTES (64 MiB, the limit the Wayland clipboard reads already use,
now shared) before reading its first bytes, and reads the rest with a
bounded reader, so a file that grows after the check is read to at
most one byte past the limit and skipped. A skipped file lets the next
copied file that is art paste, as an unreadable one does.
2026-11-14 05:38:36 -08:00
dotCooCoo 8a4815de69 Merge main into fix/i18n-adjacent-placeholders 2026-11-14 05:22:27 -08:00
dotCooCoo 779591f5ca Merge main into fix/wayland-paste-copied-files 2026-11-14 04:46:48 -08:00
BFlat c1d153c051 Merge pull request #7485 from dotCooCoo/fix/quit-hides-all-windows-wayland
Clipboard: quitting on Linux takes every window off screen before the clipboard wait
2026-11-14 19:38:10 +07:00
dotCooCoo f3e097b813 Merge main into fix/web-locks-monotonic-clock 2026-11-14 02:36:36 -08:00
dotCooCoo 9735e51473 Clipboard: files copied in a file manager paste as art on core Wayland
Where the clipboard goes through the compositor's core Wayland protocol
(the Flatpak on GNOME), Paste now reads the text/uri-list a file manager
offers, else GNOME Files' x-special/gnome-copied-files, and pastes the
first file that is art before the clipboard's other types, as on the
other platforms. The list is read on the read worker and the files on
the paste's background thread. Only file: URIs with no host or
localhost are taken (RFC 8089), percent escapes decoded once (RFC
3986); other URIs are skipped, and a list of more than 1,024 URIs, a
limit of VectorCraft's own, names no file. The Paste menu item is
enabled when a file list is offered.
2026-11-14 02:24:26 -08:00
dotCooCoo 2a29c043f1 Merge main into fix/i18n-adjacent-placeholders 2026-11-14 02:00:12 -08:00
BFlat 3382abdd05 Merge pull request #7484 from dotCooCoo/fix/wayland-clipboard-stuck-pipe
Clipboard: a Wayland read or send ends when the other app moves no data for 2 s
2026-11-14 16:50:11 +07:00
dotCooCoo f46a745f57 Merge main into fix/web-locks-monotonic-clock 2026-11-13 23:02:20 -08:00
BFlat 27f8cf90f5 Merge pull request #7351 from dotCooCoo/fix/titlebar-pref-note
Preferences: System Title Bar says when the desktop keeps the title bar either way
2026-11-14 13:43:36 +07:00
dotCooCoo 82842e4fe0 Clipboard: a Wayland read or send ends when the other app moves no data for 2 s
On the core Wayland clipboard, a read waited for the app that copied to
close its pipe, and a send wrote until the app that pastes took all of
the data. An app that left its pipe open and stopped held the one read
worker, so later pastes failed at once, or held one of the eight send
threads until it closed its end.

Reads and sends now use the pipe nonblocking and wait for it with poll.
When no byte moves for 2 s (VectorCraft's own limit, the existing text
wait) the read fails without pasting partial data and the send stops;
both close their pipe. The wait starts again after each byte that moves,
so a large transfer that keeps going is not cut short.
2026-11-13 22:09:17 -08:00
dotCooCoo 6c26233a63 Clipboard: quitting on Linux takes every window off screen before the clipboard wait
Quitting can wait up to 27 s for the clipboard handles to let go before
eframe closes the windows. winit cannot hide a native Wayland window, so
the main window stayed on screen for that wait, and the X11 windows of
floating panels and documents were not hidden at all.

- A native Wayland main window is unmapped by attaching no buffer to its
  surface. The window and its connection stay open for the Wayland
  clipboard. An X11 main window, XWayland included, is hidden as before.
- On Linux the X11 windows of floating panels and documents are recorded
  as eframe creates and drops them (viewport hooks), and quitting unmaps
  them through a second X11 connection before the wait.
- The new module apps/vectorcraft/src/quit_windows.rs replaces
  app::hide_before_teardown, with tests of which windows are hidden or
  unmapped. portal_save's Wayland surface helper is shared with it.
2026-11-13 22:02:56 -08:00
dotCooCoo 729dc32b6f Printing: the spooler's note follows the printer name as its own sentence
The status after a print job read "Sent “{title}” to {to} ({note})".
With no note and a printer name that ends in parentheses, such as
"HP LaserJet (Copy 1)", the catalog matched that row and took the
parenthesized part of the name as the note, so a translation that puts
the verb after the printer split the name. The note now follows as its
own sentence: "Sent “{title}” to {to}. The spooler replied: {note}".
The status without a note is unchanged. All 27 catalogs translate the
new message, and a test checks that German keeps such a printer name
whole.
2026-11-13 21:38:29 -08:00
dotCooCoo c08d42fd58 Web: Data Recovery's lock snapshots use the monotonic clock
The browser build stamped each snapshot of the Web Locks held with
Date.now() and judged its age against Date.now(). After the system
clock was set back, an old snapshot read as fresh, so a tab could
report no lock on an area another tab still held. Snapshots are now
stamped and aged with vectorcraft_ui_egui::now_ms(), and a snapshot
stamped later than now is not trusted.
2026-11-13 20:57:53 -08:00
dotCooCoo e8f7f1b7b4 Merge main into fix/i18n-adjacent-placeholders 2026-11-13 19:11:07 -08:00
dotCooCoo 9af1ed78b0 Preferences: System Title Bar says when the desktop keeps the title bar either way
On Linux and the BSDs, the desktop draws the window's frame on X11, on
Wayland compositors that draw server-side decorations and in a window
opened through XWayland. There, with VectorCraft Title Bar on Every
Desktop off, the window has the desktop's title bar with System Title
Bar on or off, and the dialog showed nothing about it under System
Title Bar.

- The desktop app records at startup whether VECTORCRAFT_TITLEBAR is
  unset and the desktop would draw the frame without VectorCraft Title
  Bar on Every Desktop (VectorcraftApp::desktop_keeps_frame), from the
  frame probe and the launch path's XWayland choice.
- Preferences shows a note under System Title Bar in that case while
  VectorCraft Title Bar on Every Desktop is off, with rows in the 27
  catalogs that carry the neighboring title bar notes. The value is
  worked out at startup, so a Linux Display Server change shows in the
  note from the next start.

Docs: docs/control-protocol.md, docs/target-app-parity.md.
2026-11-13 16:46:36 -08:00
dotCooCoo 5b591ca96e i18n: messages with values side by side can be translated
The catalog cannot match a template with two placeholders in a row, so it
dropped those rows, and the messages showed in English where no other
row matched them. The messages now join such values into one before
they are made, so a catalog row for each one is kept, and the English
text is unchanged:

- An unknown key inside an options object names the key with the objects
  it is in (`marks.ofset`) as one value, and its suggestion too.
- A PDF or print setting outside its range names the range with its unit
  (`0.05–2 pt`) as one value.
- The raster effect resolution warning names the object's id and name as
  one value.
- The desktop app's graphics processor fallback status and the status
  after a print job is sent are separate whole messages with and without
  their hint or spooler note.

Every catalog gets rows for these messages, and the Hindi and Swedish
range rows that the catalog dropped are replaced.

New tests fail when a message or a bundled catalog row has two
placeholders in a row or no text, and the untranslated report counts a
row the catalog drops as missing instead of translated.
2026-11-13 16:26:54 -08:00
dotCooCoo c6211b35ab Docs: the Linux title bar paragraphs describe the frame the desktop draws
docs/control-protocol.md said the window has no OS decorations on
Windows and Linux. On Linux and the BSDs the app bar is the title bar by
default only on a Wayland session without server-side decorations, such
as GNOME, in a window not opened through XWayland; elsewhere the desktop
draws the frame unless VectorCraft Title Bar on Every Desktop or
VECTORCRAFT_TITLEBAR=app turns the app frame on. The paragraph now says
so.

docs/development.md said the custom title bar is the Linux default. It
now says where the app bar is the default title bar. The comment on
CUSTOM_TITLEBAR in apps/vectorcraft/src/titlebar.rs made the same
Windows and Linux claim and now names Windows only.
2026-11-13 16:24:44 -08:00
dotCooCoo ccc9c6b341 Title bar: the app bar places its window buttons by the desktop's button layout
On Linux and the BSDs, craft-window reads the desktop's window-button
layout (`button-layout` in `org.gnome.desktop.wm.preferences`) into
`Frame::App` when the desktop leaves the window's frame to the app, but
the app bar ignored it and always drew Minimize, Maximize and Close at
its right end.

- `CaptionLayout` lists the buttons at each end of the bar;
  `caption_buttons` draws them there in the listed order, first one
  leftmost, and the bar's other controls keep clear of both groups.
- The desktop app copies the layout of an app frame the desktop left to
  it. An app frame turned on by `VECTORCRAFT_TITLEBAR=app` or by
  VectorCraft Title Bar on Every Desktop, a window opened through
  XWayland, macOS and Windows keep all three at the right.

Docs: docs/control-protocol.md, docs/target-app-parity.md.
2026-11-13 14:45:12 -08:00
BFlat c9b2119552 Merge pull request #7176 from dotCooCoo/feat/monitor-profile-windows-linux
View: the canvas is drawn through the monitor profile on Windows and X11
2026-11-14 03:24:26 +07:00
BFlat 38c0f3ed61 Merge pull request #7100 from dotCooCoo/fix/flatpak-clipboard-images
Clipboard: the Flatpak on GNOME copies and pastes pictures and SVG with other apps
2026-11-14 02:38:46 +07:00
dotCooCoo af91a37669 Merge main into feat/monitor-profile-windows-linux 2026-11-13 11:12:25 -08:00
BFlat ca8e49e9e2 Merge pull request #7158 from dotCooCoo/fix/export-unused-option-warning
Export: warnings name an option the chosen format doesn't read
2026-11-14 01:54:29 +07:00
BFlat 234d8bce3d Merge pull request #7209 from dotCooCoo/fix/portal-save-portal-exit
Save As: on Linux a portal that exits during the save dialog no longer leaves the save waiting
2026-11-14 01:54:21 +07:00
dotCooCoo 796100e388 Merge main into fix/flatpak-clipboard-images 2026-11-13 09:59:55 -08:00
dotCooCoo 4dad65667f Save As: on Linux a portal that exits during the save dialog no longer leaves the save waiting
When the desktop portal's process exited while its save dialog was
open, no Response came. The stream that save_file read does not end
while the session bus stays up, so the save waited forever on the
calling thread and rfd's dialog never showed.

save_file now waits with the screen color sampler's Responses, which
moves from linux_screen_color/request.rs to portal_request.rs and is
built on Linux and the BSDs. Before the call it listens for the
Response and for the bus's NameOwnerChanged for the portal's name, so
the wait ends with an error when the connection that replied leaves
the bus, and the caller shows rfd's dialog, as for other portal errors.

When the bus reports the portal gone, the wait first reads the
Responses already queued, so an answer the portal sent before it left
is still the answer. Before, the sampler's wait could take the bus's
report while that answer was queued and end with an error.

The mock portal gains three modes that close its connection after the
reply: 300 ms later without a Response, at once without a Response,
and at once after the Response. The private bus helper of the
sampler's tests moves to portal_request.rs, and the save dialog's
tests use it, so a failing test also stops its bus.
2026-11-13 09:41:13 -08:00
dotCooCoo 4b50fdba1c View: the canvas is drawn through the monitor profile on Windows and X11
Preferences > Performance > Use Monitor Profile for Canvas (on by default,
`monitorProfileDisplay`) converts the canvas's art, artboard paper and
transparency grid from sRGB into the ICC profile of the display that shows
most of the main window, after any proof. Arranged panes and the render
worker's frames are converted too; the worker keeps its frame in sRGB.

- Windows: the display's default profile for its standard color mode
  (ColorProfileGetDisplayDefault, GetICMProfileW where it is missing). A
  display with Advanced Color on is left to Windows.
- X11: colord's profile for the RandR output, then the output's
  `_ICC_PROFILE`, then the screen's when only one output is active.
- A Wayland session stays sRGB; macOS converts the window itself.
- A profile that is missing, larger than 1 MiB, not an RGB display
  profile or unreadable leaves the canvas sRGB, with the reason in
  `ui.inspect`'s `displayProfile`.

The conversion is sampled into a 33x33x33 table when a profile is read, on
a background thread. Exports, `ui.render` and the document are unchanged.
2026-11-13 07:27:30 -08:00
dotCooCoo d04a19ac53 Export: warnings name an option the chosen format doesn't read
`document.export`, `document.serialize` and `document.exportSelection`
accept a key that only another format takes. `{"format": "pdf",
"quality": 80}` wrote the PDF and gave no warning about `quality`.

The reply's `warnings` now name each such key, in the wording of a
save's note: "`quality` was not used: PDF files don't read it".

- The format's own options, the commands' own keys, null values and an
  exporter plug-in's format get no note.
- The note names the kind of file written. A legacy `.ai` file
  (`aiVersion: "7"`) reads `outlineText`, `hiddenObjects`,
  `transparentImages`, the artboard choice and `useArtboards`, and
  beside `aiVersion` no other option. The other `.ai` files don't read
  those three options or `preserveEditing`, which is always on for
  them.
- An export doesn't read `separateArtboards`, or `range` for a
  `vectorcraft` or `template` file. A save reads them to write each
  artboard to a file of its own.
- In the app, an export that automation asked for (`app.export` with a
  path, `file.exportAs` run as a command) gives the same notes in its
  reply and in the status bar. A Background Export replies before the
  file is written, and that reply has the notes. An export that a
  person starts from the File menu gets none.
- Export As gives a template export no `useArtboards` or `range`: a
  template doesn't read them.
- `vectorcraft-cli convert` sends `outlineText` only with
  `--outline-text`, and `hiddenLayers` only to the formats that read
  it. A conversion then warns only about an option the command line
  gave.

`document.save` gives its notes as before: it does not apply the `.ai`
rules above.

Docs: docs/mcp.md, docs/control-protocol.md,
docs/target-app-parity.md, the params text of the three commands.
2026-11-13 06:58:28 -08:00
dotCooCoo 0fd757c6b8 Clipboard: the window closes at once and quitting waits up to 27 s for the Paste check
On Linux the Paste menu's background check holds its own clipboard
handle. When the app quit while that check's X11 text read was still
unanswered, quitting stopped waiting for the check's thread after 5 s,
but the handle's read worker holds arboard's handle until 25 s after the
read was sent. The app's own handle was then dropped first, so it was
not the last one alive to hand what was copied to a clipboard manager.

- CLIPBOARD_PROBE_STOP_WAIT (27 s, exported from vectorcraft-ui-egui)
  replaces the 5 s bound: the 25 s X11 read limit plus LOAD_WAIT, the
  2 s limit on waiting for a reader to stop. Quitting still ends after
  it when a host's handle never lets go.
- On Linux and the BSDs, on_exit hides the main window before eframe
  drops the app, so the window closes at once while the process waits
  for the clipboard handles. The window is hidden, not closed, and the
  connection the clipboards use stays open. winit hides X11 windows,
  XWayland ones included; it cannot hide a native Wayland window, which
  stays on screen until the wait ends. macOS and Windows are unchanged.
- Probe's Drop waits through an injectable function, so a test drives
  the wait with a controllable clock while the probe's handle is still
  being dropped and checks that it is dropped before the app's.
- A Linux test in the app checks the bound against X11_READ_LIMIT and
  LOAD_WAIT, so raising either fails it.
- Comments and docs/development.md describe the wait.
2026-11-13 04:33:41 -08:00
dotCooCoo 6bf988a0e1 Clipboard: the Flatpak on GNOME copies and pastes pictures and SVG with other apps
Where arboard has neither data-control nor X11 (the Flatpak on a GNOME
Wayland session), Copy and Paste used smithay-clipboard on the window's
connection, which carries text only. They now use a core wl_data_device
client on that connection.

- One Copy offers the PNG as image/png, the SVG as image/svg+xml (with
  Include SVG Code on) and the text as text/plain;charset=utf-8,
  UTF8_STRING and text/plain. A format with no data is not offered.
- Paste reads SVG, then text, then PNG. Blank text, or text that only
  names a picture, gives way to the PNG, and a failed or empty SVG read
  falls back to the types after it. The Paste menu item is enabled by the
  types offered, without reading any data.
- The clipboard holds VectorCraft's Copy while its data source is not
  canceled and the offer has the Copy's types.
- A read takes 64 MiB at most. Text waits 2 s, SVG and PNG 10 s off the
  UI thread. Another app's paste is sent on its own thread, 8 at once.

smithay-clipboard is no longer a dependency of the app.
2026-11-13 02:31:04 -08:00
dotCooCoo 7907bae6c3 Merge main into feat/new-document-profiles 2026-11-12 13:42:10 -08:00
dotCooCoo 22a19db2cd Merge main into feat/new-document-profiles 2026-11-12 09:29:46 -08:00
dotCooCoo fe34c2b818 Merge main into feat/custom-arrowheads 2026-11-12 09:23:20 -08:00