Skip to content

Apply patches from v0.30.1 to v0.30.13#12

Open
bnavetta wants to merge 117 commits into
warpdotdev/v0.30.xfrom
ben/apply-v0.30.1-patches-to-v0.30.13
Open

Apply patches from v0.30.1 to v0.30.13#12
bnavetta wants to merge 117 commits into
warpdotdev/v0.30.xfrom
ben/apply-v0.30.1-patches-to-v0.30.13

Conversation

@bnavetta
Copy link
Copy Markdown

This moves our fork of winit from v0.30.1 to v0.30.13

#6 carried over an upstream patch that's since been released, so I went with the upstream version.

daxpedda and others added 30 commits June 15, 2024 20:00
Not using `NSColor::clearColor()` results in Quartz thinking that the
window is not transparent at all, which results in artifacts.

However, not setting the `windowBackgroundColor` in
`Window::set_transparent` results in border not properly rendered.

Fixes: 94664ff (Don't set the background color)
This is a breaking change, thus revert it for patch series.
The c_char type, which was used under the hood is different depending
on arch, thus use it directly instead of i8.

Fixes rust-windowing#3735.
This new implementation uses:
- The NSAppearanceCustomization protocol for retrieving the appearance
  of the window, instead of using the application-wide
  `-[NSApplication effectiveAppearance]`.
- Key-Value observing for observing the `effectiveAppearance` to compute
  the `ThemeChanged` event, instead of using the undocumented
  `AppleInterfaceThemeChangedNotification` notification.

This also fixes `WindowBuilder::with_theme` not having any effect, and
the conversion between `Theme` and `NSAppearance` is made a bit more
robust.
The latter syntax is deprecated and will be removed in Rust
2024 edition. This also generates a warning with current
versions of Rust.
taiki-e/checkout-action has a few advantages over actions/checkout,
such as:

- It is written in Bash rather than Node.js
- It does not have frequent breaking changes, reducing churn

Signed-off-by: John Nunley <dev@notgull.net>
Rust tooling generally works better this way. This includes
rust-analyzer, but more noticeably the output from `tracing` typically
prints the module path, which did not correspond to the actual file
system before.

Concretely, tracing output from the macOS backend changes from printing:
`winit::platform_impl::platform::util`
To printing:
`winit::platform_impl::macos::util`
Nothing wrong will happen if we ignore events when compositor is at
wrong, at least crashing because compositor is just _wrong_ probably is
not a great option.

Links: alacritty/alacritty#8065
Update SCTK as a follow-up to 1170554 (ignore events to dead
objects) fixing it for wl_output.
`clippy::doc_lazy_continuation` was added, which needed some fixing from our side.
This type comes from the user and stored for the entire lifetime, so
no need to hide it from them after they've passed it to winit.

Fixes rust-windowing#3818.
This was detected by a new change in Nightly Rust that applied
`#[must_use]` to the return value of `Box::into_raw()`.
madsmtm and others added 27 commits April 30, 2025 20:46
Instead of panicking, raise a warning and return `None` or similar.

Co-Authored-By: RJ <rj@metabrew.com>
The `text` is retrieved as UTF-8 while `attributes` are based on UTF-16,
thus the offset was getting out of sync on some unicode payloads
like surrogate pairs.

Fixes rust-windowing#3967.
In Windows versions < 17763, `GetProcAddress("rust-windowing#132")` from `uxtheme.dll`
also returns a non-null pointer. However, the function does not match
the expected `extern "system" fn() -> bool` prototype, which causes a
crash when it is called.

This fix ensures compatibility by adding proper checks to prevent such
crashes on older Windows versions.
Will take a while to move to 1.0 for everyone.
The lint is needed for stable, but is no longer present on nightly, so
silence it for the time being.
Winit only supports text, thus we should ignore the rest
instead of crashing.
The xfixes implementation is not that reliable and rather simple to
replace, so use x11rb to implement the same functionality.

Fixes rust-windowing#4120.
Co-authored-by: avitran0 <holyhades64@gmail.com>
macOS native Pinyin IME can send a selected_range that exceeds the
marked text string length (e.g. index 8 for a 6-character string).
This caused an NSRangeException in substringToIndex:, crashing the
application with SIGABRT.

Clamp both location and end to the string's UTF-16 length before
calling substringToIndex.
The `text` field on `KeyEvent` was hardcoded to `None` on Android,
making it impossible for custom `NativeActivity` subclasses that
show the IME to receive functional text input using *for example* the
existing `winit-egui` crate which relies on this field being set.

Use `Key::to_text()` on press events to derive `text` from
`logical_key`, matching the convention used by the Windows and macOS
backends.

Supposedly that doesn't include all kinds of special virtual unicode
keys, but at least the basics work this way.
@bnavetta bnavetta requested review from alokedesai and vorporeal May 16, 2026 15:32
Comment thread .github/workflows/ci.yml
Comment on lines +241 to +253
name: Minimize JavaScript
runs-on: ubuntu-latest

steps:
- uses: taiki-e/checkout-action@v1
- name: Install SWC
run: sudo npm i -g @swc/cli
- name: Run SWC
run: |
swc src/platform_impl/web/web_sys/worker.js -o src/platform_impl/web/web_sys/worker.min.js
- name: Check for diff
run: |
[[ -z $(git status -s) ]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.