This fixes the preview window not showing with the Qt backend,
because the preview uses a timer to show the window, but we would not
start the Qt timer and so the window was never shown
In the future, the plain winit::event_loop::EventLoop won't be usable for window creation anymore. There are two places where we need it:
1. From places where we also have access to the shared backend data.
2. From the top-level create_winit_window() function.
The latter we have to eliminate in the future, so might as well do it now and clean up to have one thread local less.
Commit cd6f2e2 reformated the .toml, but the 80 char width column is
judged too small to be practical
Add a .taplo.toml file
Also do not split feature array
In preparation for removing it altogether, remove the call to winit::platform::wayland::EventLoopExtWayland::is_wayland() with a matches!(winit_window.window_handle(), WindowHandle::Wayland(...))
This means the event loop spawning goes through the backend, which will permit for state from the Backend struct to be available when spinning the event loop even when spawning it merely.
The winit backend defaults to locating a canvas element with the id "canvas". After the parent commit, this id can't be overridden by the API, so we can remove the function parameters.
(The parent commit implements the override via an attribute hook)
Don't do partial tree rebuilds if we know that a full rebuild is pending and that the current focus node may thus not be node mapped yet.
Amends 5ff5c0464cFixes#7854
... using taplo with default settings
I tried this with 4 spaces indentation, but the patch is almost as
big as this one, so I went with default settings instead as that
is just easier:-)
We can't just do `s/#\[no_mangle]/#[unsafe(no_mangle)]/g`
because the version of cbingen we use doesn't understand the unsafe
attribute yet.
Part of #7998
The core library expects command to be mapped to control, and control to meta, for the shortcut detection. This needs to be done separately for the wasm input handling.
This helps with #7477 by fixing cmd+a. Unfortunately, the "copy" and "paste" events, while intercepted by Safari, aren't somehow delivered to our canvas element.
We really need to dispatch the release event otherwise the wrong
item keeps the drag and this breaks the behavior.
This is not perfect yet as if the release is done on the wrong popup,
then we'll still not get the release event.
We should probably remove the grab when a popup open. But that's
slightly more complicated
We decided that the compatibility with people having enabled the extra
format in image 0.24 [1] is not worth it compared to the extra compilation
time most people gets by default when they don't need this feature.
(Which is less than 10% slower when the feature is enabled)
Since then there is no need for compat-1-10, remove it
[1] by depending directly on image 0.24 in their Cargo.toml and enabling
the features, which will not work with Slint 1.10 that now use image 0.25
Work around pump_events() with `Some(std::time::Duration::ZERO)` still entering `epoll` and thus not returning, preventing us from processing node events.
cc #7657
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
(or popup menu gets closed)
We receive an empty `QInputMethodEvent` when the window gets active
and we should not have a replacement range if there is nothing to
replace, otherwise we clear the selection
We always offer the Skia software renderer fallback in
`new_try_vulkan_then_opengl_then_software`, so make sure that the drm
and mmemap dependencies are activated, needed to compile swdisplay.rs.
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.
See https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrow
```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_borrow
cargo fmt --all
```
This is a hacky approach, but does help a lot with the tedious fixes.
See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or
```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or
cargo fmt --all
```
Add `with_default_menu_bar` to winit's `BackendBuilder` to permit applications
to provide their own menu bar.
Fixes the lsp's Window -> Keep on top menu on macOS.
Opening a combobox with the winit backend implies creating a popup and a transfer of focus. The former will re-create the accessibility tree and cause pending_update to be set to true. The latter will send a notification to the accesskit adapter and unfortunately the (new) focus node will not be known to accesskit yet, causing it to panic.
Since we have a pending update and the new tree update will include the correct focus, we can just sking sending one in this moment.
Fixes#7403