- Windows 32bit GNU (stable, nightly): Rust 1.100 no longer ships host
tools for i686-pc-windows-gnu, so the toolchain can't be installed
(upstream dropped the job in rust-windowing/winit 6853ca5e). Only
stable and nightly are excluded; 1.70.0 still covers the target.
- web clippy (stable): code generated by #[wasm_bindgen] in newer
wasm-bindgen releases uses const features stable since 1.77, which
clippy::incompatible_msrv reports against the 1.70 MSRV. Allowed on
the web module; the MSRV build locks an older wasm-bindgen.
- Android, iOS, Redox: clipboard_native_probe was gated on
all(unix, not(macos), feature = "wayland"), which those targets match.
It uses the wayland_platform alias now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the lockfile step fixed, CI reaches steps that were never green on
this branch:
- rustdoc -D warnings: escape `*` inside <kbd> (invalid_html_tags) and
wrap a bare URL in dark_mode.rs (nightly's bare_urls).
- docs.rs check (nightly, every platform): platform::wayland is built
under docsrs on all platforms, but its clipboard API names
platform_impl::wayland, which only exists with wayland_platform. The
clipboard items are now gated on wayland_platform.
- Rust 1.70.0 on Windows: update_system_caret is pub but takes the
pub(crate) CaretChange (E0446); it is pub(crate) now.
- ime_patches/pointer_patches read sources with CRLF on a Windows
checkout (* text=auto) and missed patterns that span lines; source()
normalizes to LF.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- typos.toml ignores the commit SHA 6a87addd, which typos reads as the
word "addd" in PATCHES.md and docs/egui-037-migration-plan.md.
- The "Generate lockfile" step pins syn as syn@2, since syn 2 and syn 3
are now both locked, and pins serde 1.0.228, foreign-types-macros
0.2.3 and tracing-web 0.1.3, whose newer releases need syn 3 or a
newer wasm-bindgen. On the 1.70.0 jobs the step resolves with
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback, so the lockfile
only holds versions whose rust-version allows 1.70.0, and the
wasm-bindgen crates move back to 0.2.105.
- deny.toml skips the second versions of syn, thiserror,
thiserror-impl, jni-sys and redox_syscall, and allows
android-activity 0.6.1's import-games-sdk.sh by checksum.
The unreleased changelog gets a Changed entry: window blur on Wayland
needs `wayland-kde-blur`, `Window::set_blur` and
`WindowAttributes::with_blur` do nothing on Wayland without it, and the
implicit `wayland-protocols-plasma` feature has been removed.
FEATURES.md describes Window blur and names the feature. The W42 row in
PATCHES.md names commit `0ecdbe5e` and this pull request.
The `wayland` feature, which is on by default, enabled
wayland-protocols-plasma for the org_kde_kwin_blur_manager protocol. That
crate is MIT, but the blur protocol XML it turns into code is
LGPL-2.1-or-later, so every Linux build compiled LGPL-derived bindings.
The new `wayland-kde-blur` feature, off by default and not part of
`wayland`, enables the dependency and the blur code. Without it,
Window::set_blur and WindowAttributes::with_blur are ignored on Wayland
and the window logs the request at info level. With it, blur works as
before.
CI gets a job that fails when the default features, or any feature other
than `wayland-kde-blur`, bring in wayland-protocols-plasma, and a Linux
row that builds, tests and lints with `wayland-kde-blur`.
Holding Alt and typing a number on the number pad (Alt+0181 for µ) makes
Windows send the character in WM_CHAR after Alt's key-up. The keyboard
builder adds a WM_CHAR only to a pending key press, so after a release
it took the character for IME text and dropped it: Alt codes typed
nothing in any text field (storytold/pdfcraft#5746).
When Alt's release is followed by WM_CHAR or WM_SYSCHAR, the character
now goes on a press of its own, reported like a character injected with
VK_PACKET: an unidentified key whose text and logical key are the
character. A release follows the press at once, so the key isn't left
down. A character after any other key's release is still left to the
input method.
Tested with a message-only window: Alt's release then the queued µ give
the Alt release, then a press with text "µ" and its release; without
the fix the µ gives no event. A character after Enter's release still
gives none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b452532's test called set_var and remove_var while other test threads
ran, which is the unsoundness W30 avoids by leaving the launcher's
variable alone; a variable no other test reads doesn't make it sound,
since any thread reading any variable races the write. The test now runs
itself in a child process with the variable set, then removed, and
checks the child ran its one test; this process's environment never
changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The policy tests gave the token through a closure; this one reads it from
a real environment variable (one no other test uses, so setting it races
nothing): set, the first window takes it; cleared, it takes none. Also
rustfmt startup_token.rs, which had four lines over 100 columns.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the immutable upstream reference and 0.30 adaptation, protocol version and phase handling, and current-head contributor checks with no axis events during captured gestures. Keep KDE/Sway and physical teardown explicitly unverified.
Port the pinch input path from storytold/pdfcraft#1580 to the resolved winit fork, preserving newer drag and IME seat teardown. Test cumulative scales, cancellation, invalid input and unsupported surfaces.
eframe never gives winit an activation token, so with StartupNotify=true
GNOME kept its busy cursor for 15 seconds after the window appeared, and a
Wayland window opened without focus. The first window created without a
token now takes the one the launcher put in the environment
(XDG_ACTIVATION_TOKEN on Wayland, DESKTOP_STARTUP_ID on X11) and hands it
back as a token given through with_activation_token would be. Later
windows don't reuse the spent token, and an empty or oversized (over 1,024
bytes) token is ignored. The variable is left in the environment, unlike
reset_activation_token_env: changing the environment while other threads
may read it is unsound.
Port of PdfCraft's vendored winit patch (14), from storytold/cadcraft#2030.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each commit makes the compositor send done, and input-method-v2 compositors ignore input-method commits against an older serial, so an app calling it every frame could lose typed text.
The replacement range is applied only in the arms that deliver the text, so text dropped while IME isn't allowed doesn't remove text from ImeDocument that the app still shows.
The window procedure leaves Preedit before CPS_CANCEL, so WM_IME_ENDCOMPOSITION doesn't read GCS_RESULTSTR and commit it, and sends the empty preedit itself, as X11, Wayland and macOS do.
Input methods that correct the text around the cursor, such as
Vietnamese engines and predictive keyboards, need the field's text
(text-input-v3 `set_surrounding_text`) and a way to delete part of it
(`delete_surrounding_text`). winit master added both with new core types
and an `Ime::DeleteSurrounding` event; winit 0.30's `Ime` enum is
exhaustive, so they come here as a Wayland extension instead:
- `WindowExtWayland::set_ime_surrounding_text(text, cursor, anchor)`
clamps the byte offsets to character boundaries and cuts text over the
protocol's 4000 bytes around the cursor and selection. Enabling a text
input sends it again with the purpose and cursor area, which enabling
resets; disallowing IME forgets it.
- A deletion goes out with the `Ime::Commit` of the same input method
update, an empty one if the update has no commit.
`WindowExtWayland::take_ime_delete_surrounding` returns it while that
commit is handled, so the application deletes after removing the
preedit and before inserting the text, in text-input-v3's order.
Co-authored-by: DorotaC <43449960+dcz-self@users.noreply.github.com>
Replacement ranges were honoured by sending one Backspace per replaced
character. Toolkits delete a whole grapheme cluster per Backspace, so
replacing text after a combining accent, a flag or a ZWJ emoji deleted
text before the replaced range.
The deletion now goes with an Ime::Commit, as on Wayland:
WindowExtMacOS::take_ime_delete_surrounding returns it, in UTF-8 bytes,
while the app handles that commit. A replacement before a preedit, such
as press-and-hold marking the letter it accents, gets an empty commit.
Shortcuts such as Ctrl+C are defined by Latin letters, so on a Russian,
Greek, Arabic, Hebrew or Thai layout a toolkit can't match them from the
characters the keys type. GTK and Qt fall back to the first Latin layout
group for this.
The `KeyEventExtLatinLayout` extension reports, for a key event, what the
key types on the keymap's first Latin layout when the active layout isn't
Latin, letter or not, and whether the active layout is Latin. A toolkit
can then tell a key without a Latin letter (Dvorak's ' on the key that
types й on Russian) from a user without a Latin layout. A layout is Latin
when most of its 26 letter keys type Latin letters, so Dvorak and AZERTY
count as Latin and keep their own letters.
Toolkits need to drop the composition when the text cursor moves to
another field or the user clicks elsewhere in the text, without turning
IME off and on: otherwise the input method continues the composition in
the next field. `reset_ime` discards the composition without committing
it and sends an empty preedit if one was shown.
- X11: resets the window's input context with `XmbResetIC`. IME requests
are also handled before each X event, so a reset or allow request made
when focus moved reaches the input method before the next key does.
- Wayland: disables and enables text input in two commits, so the
compositor deactivates and reactivates the input method, then sends
the purpose and cursor area again.
- Windows: while a composition is in progress, cancels it with
`ImmNotifyIME(NI_COMPOSITIONSTR, CPS_CANCEL)`. The IME ends the
composition with its usual messages; the result string stays empty.
- macOS: the input context discards its marked text, and an empty
preedit is sent if the input method didn't send one.
- iOS, Android, Web and Orbital ignore it.
A key pressed with ⌘ was named by charactersIgnoringModifiers, which
ignores the layout's table for ⌘. On "Dvorak – QWERTY ⌘" the layout
types Dvorak letters but QWERTY ones with ⌘, so ⌘V was reported as ⌘K
and opened PdfCraft's command palette (storytold/pdfcraft#3655). With ⌘
held, the logical key is now UCKeyTranslate's character with cmdKey
(and shiftKey when Shift is held), falling back to the old rule when
the table has no character.
KeyEventExtMacOS::key_with_command reports the ⌘ table's character for
every key event, as key_without_modifiers does for the base table, so
shortcut matching and labels can use it without ⌘ held.
The view reports a caret to input methods: after the text inserted
since the caret last moved for another reason (a command key, a click,
a shortcut, IME toggled), with marked text after it (ImeDocument).
Dictation, which inserted nothing while selectedRange was NSNotFound
(rust-windowing/winit#4666), now has a place to insert. Replacement
ranges that reach the caret are honoured (#3617): the replaced text is
deleted with Backspace presses before the new preedit or commit, which
toolkits already handle. Press-and-hold then replaces the letter with
the accent picked instead of typing it after the letter. Reporting a
caret also makes held letters in text input open the accent menu
instead of repeating, as in other Mac apps; the repeats the input
method takes for the menu aren't typed.
Text an input method types without a composition during a key press is
committed when it isn't the key's own text, and the key's text isn't
sent: Chinese punctuation (,for ,) and the ideographic space arrived
as the key's ASCII character.
An input method calling the view while its window is torn down no
longer panics inside an Objective-C callback, which aborted: the
firstRectForCharacterRange guard is master's d6f7a28 (#4333), and
queued events and the input context are checked the same way.
Co-authored-by: Jeremiah S <46010924+HXavS@users.noreply.github.com>
Setting the IME spot is a synchronous XIM request, and it went out after
the next X event, often one carrying an input method's reply to a key.
Xlib handles the keys an input method forwards back while it waits for
the request's reply: it puts them back on the event queue in reverse
order and marks only the last one as forwarded, so the others are
filtered again. The input method gets its own keys back as new key
presses, and the app gets them after the text committed with them.
Vietnamese engines in fcitx5 that fix a word by forwarding BackSpaces and
committing the new tail garble the text this way
(rust-windowing/winit#4777, storytold/wordcraft#2932).
Input methods only send keys back in answer to keys the client gave
them. The latest spot for each window is now queued and sent once no X
event is queued and no event has gone to the input method for 100 ms;
the event loop wakes up to send it.
Disallowing IME destroyed the window's input context and allowing it
created a new one. Input methods keep their per-context state only while
the context lives, so each focus change between text fields reset it:
Vietnamese Telex turned off, and the new context stayed unfocused until
the window lost and regained the focus.
The window now keeps the context it was created with, in the preedit
style. Allowing IME focuses it; disallowing it resets the composition and
unfocuses it, and keys are no longer filtered through it.
While an IME uses a key, WM_KEYDOWN carries VK_PROCESSKEY. winit sent
it as a Process key press with the key's physical code, and apps that
fall back to the physical key (egui-winit does) took it as a press of
that key: Backspace, Enter or an arrow typed into a composition acted
both in the composition and in the app. Such a key-down is no longer
sent, unless the IME passes text on with it as WM_CHAR. The key-up still
arrives with the real virtual key.
Guarded in tests/ime_patches.rs. Part of storytold/craft-libs#198
(item I6).
Some IMEs place their composition and candidate windows at the system
caret (GetCaretPos, GetGUIThreadInfo) and ignore ImmSetCandidateWindow:
Sogou, and some Japanese IMEs. winit created no caret, so those windows
didn't follow the text. A window that has the keyboard focus and allows
IME now keeps a hidden caret the size of the last IME cursor area,
created on focus or when IME is allowed, moved with
set_ime_cursor_area, and destroyed before the window loses the focus
(Windows has one caret per thread).
The policy is plain Rust (ime_caret.rs), so its tests run on every
platform through tests/ime_patches.rs, with a guard on its callers.
Part of storytold/craft-libs#198 (item I6).
Most of these patches can only be exercised with a real input method or
compositor, so `tests/ime_patches.rs` and `tests/pointer_patches.rs`
check that each fix is still in the source and fail if a rebase drops
it. The Wayland scroll-phase policy (W13) is plain Rust, so its unit
tests run in `tests/pointer_patches.rs` too.
Use the reported axis source so wheel, wheel-tilt and continuous-source scroll events report
`TouchPhase::Moved` instead of starting a finger gesture that never ends; egui then follows modifier
release instead of keeping Ctrl zoom latched. Finger momentum is unchanged. The phase policy lives
in `seat/pointer/scroll.rs`. Taken from storytold/pdfcraft vendor/winit patch (13)
(storytold/pdfcraft#1569). No upstream winit PR yet.
Co-authored-by: Brandon Thomas <echelon@gmail.com>