Apply patches from v0.30.1 to v0.30.13#12
Open
bnavetta wants to merge 117 commits into
Open
Conversation
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()`.
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.
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) ]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.