Commit graph

1483 commits

Author SHA1 Message Date
Simon Hausmann
c1e1a81b93 Fix some wasm build warnings 2024-07-03 15:46:28 +02:00
Simon Hausmann
38bc37f72a Add missing dispatch of resize event to the window item when the user resizes the window while being hidden 2024-07-03 14:22:30 +02:00
Simon Hausmann
dd49ecacf3 Make an effort to avoid returning None from WindowAdapter::position() when we have no native window
When the user queries the physical position of the window after setting a logical position, but we don't have a window, use the last known scale factor.
2024-07-03 14:22:30 +02:00
Simon Hausmann
8c1ee12f84 Remove outdated comment
The new enum keeps the winit::window in an Rc (and we did before as well).
2024-07-03 14:22:30 +02:00
Simon Hausmann
a75b9fe643 Clean up WinitWindowAdapter construction
Call resume() on the renderer in one place, instead of several.

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-07-03 14:22:30 +02:00
Simon Hausmann
49df131625 Fix slint::Window::hide() on Wayland with winit
On Wayland hiding a window requires destroying the surface, which
means destroying the winit window as well as the underlying graphics
surface. The latter is tricky as we have to keep the renderer around,
as our WindowAdapter trait's `renderer()` function returns a `&dyn
Renderer` and that also has to work without a window (to obtain text
metrics).

Fixes #4225

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-07-03 14:22:30 +02:00
Simon Hausmann
862b1e1dfe winit software: remove unneccessary winit_window rc field
We can obtain that from the softbuffer surface.
2024-07-03 14:22:30 +02:00
Simon Hausmann
5afb9768c5
Fix crash on app shutdown on Wayland (#5534)
Valgrind would report invalid reads on the wayland clipboard shutdown code, suggesting that the wayland
display has already been destroyed.

Since the display handle isn't refcounted, we must make sure that the wayland clipboard is around as long as the wayland display handle, provided by the winit event loop.
2024-07-03 13:05:06 +02:00
Olivier Goffart
60569673b5 Remove some cargo:rustc-check-cfg output:
- The cfg_aliases crate does it out of the box already
 - Don't create a build.rs for this only purpose when it can be added in
   Cargo.toml lints group. (This wasn't possible when the warning was
   first introduced in nightly)
2024-07-02 13:33:48 +02:00
Olivier Goffart
161a734805 Qt: fix unexpected_cfgs warning
We didn't emit the directive for all features
2024-07-02 11:50:27 +02:00
Olivier Goffart
1baf227e9e Update AccessKit 2024-07-02 11:45:46 +02:00
Simon Hausmann
0aaf5b57ab Fix formatting 2024-07-02 09:23:09 +02:00
Simon Hausmann
a24c04fd84 linuxkms: Fix build with just renderer-skia
That one also falls back to software and when used with linuxfb needs
the timer based animation driver.
2024-07-02 08:50:42 +02:00
Simon Hausmann
6d14f5ca15 Fix unused type warnings in i-slint-backend-linukxms build with default features
When no features are enabled, the TimerBasedAnimationDriver would be unused.
2024-07-01 11:33:46 +02:00
Tobias Hunger
dbde3c2f9e janitor: Remove unused variable warning in winit 2024-06-28 18:59:01 +02:00
Simon Hausmann
fd8bc22b40 Fix rustdoc warning about link to non-existent function 2024-06-28 15:33:59 +02:00
Simon Hausmann
bf919d300d Work around sometimes missing resize event on macOS with winit
Fixes #5509
2024-06-28 15:26:36 +02:00
Simon Hausmann
7f05b8aa39 Changed ElementHandle click API to a single_click and double_click function taking the button
That way one can also simulate double right click, for example. This is a little less convenient, more generic, but a reasonable compromise (perhaps :-)
2024-06-28 13:56:51 +02:00
Simon Hausmann
e78e68a1ba System Testing: Add support for clicking on elements 2024-06-28 13:56:51 +02:00
Simon Hausmann
b45945a234
Add support for async unit testing and element handle click events (#5499)
This patch adds async click functions to ElementHandle and adds timer support to the testing backend's event loop.
2024-06-27 17:05:58 +02:00
Olivier Goffart
f4085cfd13 winit: Fix setting the size with set_size before showing the window
Fixes #5489

We shouldn't resize the window to the size of the WindowItem after
start. This happens when set_size is called before show. The the
resize event didn't yet propagate the size to the WindowItem properties.
2024-06-27 16:12:35 +02:00
Simon Hausmann
155156aab9 System testing: Add support for grabbing window contents as PNG encoded image 2024-06-27 10:25:03 +02:00
Arnold Loubriat
ce2db77e88
Add the accessible-placeholder-text property (#5464) 2024-06-26 12:59:22 +02:00
Tobias Hunger
87e4cb8951 janitor: Fix warning about unused import 2024-06-24 14:59:47 +02:00
Tobias Hunger
cd3b60c889 janitor: Fix clippy "creates a reference which is immediately dereferenced" 2024-06-24 14:59:47 +02:00
Simon Hausmann
d86ae620b4 Add a very basic and crude implementation for software rendering to the legacy Linux framebuffer interface
This assumes the same xrgb888 interface that the drm dumb buffer uses, too. Missing, beyond different pixel depths is:

 - mode setting (requires fbset on the command line right now)
 - vsync (not sure if possible)
 - line padding
2024-06-22 09:37:34 +02:00
Simon Hausmann
011a3e8a47 linuxkms: Hide the drm dumb buffer software display implementation behind a trait
... to make room for a linuxfb fallback implementation
2024-06-22 09:37:34 +02:00
Simon Hausmann
977b827df2
Add Rust API to grab the contents of a slint::Window into a slint::SharedImageBuffer (#5445) 2024-06-22 09:33:18 +02:00
Olivier Goffart
845f40da9c linuxkms: ignore warning when no renderer are active 2024-06-20 13:18:44 +02:00
Simon Hausmann
83e7f8c6af Fix wasm build 2024-06-18 17:48:17 +02:00
Olivier Goffart
5d9682b2ad Remove PhantomData 2024-06-18 17:48:17 +02:00
Olivier Goffart
fe6f845ca0 Android: port to rwh 0.6 2024-06-18 17:48:17 +02:00
Simon Hausmann
d7670d4feb Fix visibility warning with Rust 1.73 2024-06-18 17:48:17 +02:00
Simon Hausmann
9e94ec5fe4 winit: Use run_app_* instead of the deprecated functions
That requires implementing the ApplicationHandler trait and adds an extra dispatching impl to ensure the active event loop ref is set in TLS.

Also allow the deprecated create_window() for now.
2024-06-18 17:48:17 +02:00
Simon Hausmann
045ceec0a3 Fix two winit deprecation warnings 2024-06-18 17:48:17 +02:00
Simon Hausmann
7e7a3f72f0 Fix wasm build 2024-06-18 17:48:17 +02:00
Simon Hausmann
760e04a411 Fix build
- Upgrade linuxkms backend to rwh06
- Adapt vulkan_surface to internal Skia surface trait changes made in earlier commit
2024-06-18 17:48:17 +02:00
Olivier Goffart
dc9f1d5bf1 WIP: upgrade accesskit and accesskit_winit 2024-06-18 17:48:17 +02:00
Simon Hausmann
4c888bf1ae Port the Skia renderer to rwh06 and the new softbuffer
... by accepting an Rc<dyn Has*Handle> in the interface. This is required for softbuffer use.
2024-06-18 17:48:17 +02:00
Simon Hausmann
40f2833bac Fix macOS build of glutin setup code used for FemtoVG renderer in winit backend 2024-06-18 17:48:17 +02:00
Olivier Goffart
865e3e940d WIP: update winit, glutin, raw-window-handle 2024-06-18 17:48:17 +02:00
Olivier Goffart
46623a658b winit backend: move the clipboard info outside of the event loop
It doesn't belong there and this will make further refactoring easier
2024-06-18 17:48:17 +02:00
Olivier Goffart
4eea278ef7 TextEdit qt: fix text selection
Fixes #5417
2024-06-18 17:03:54 +02:00
Olivier Goffart
99bb23eb02 Qt backend: fix combobox quiting the application with Qt6
When the popup window is destroyed, the hack we did to close the app on
the last window was too aggressive with Qt6 and closed the application
when it shouldn't have.

Fixes #4803
2024-06-18 15:51:46 +02:00
Daniel Stuart
436efaceea renderer: Use TextWrap enum for text_size function 2024-06-17 23:52:04 -07:00
Daniel Stuart
9f63d157d1 Add character wrapping for Qt Backend
This adds a new wrapping mode called `char-wrap`, which allows for wrapping at any character.
Currently, it only supports the Qt backend, with the other backends falling back to `word-wrap` when this option is selected.
2024-06-17 23:52:04 -07:00
Wannes Van Leemput
9f3eef8960 Allow one winit touch id at the time 2024-06-17 14:46:21 +02:00
Simon Hausmann
a1857e6154 system testing: add a unit test to verify that the manual AccessibilityRole mapping is always complete
The enum is non-exhaustive, but we can do an additional run-time check.
2024-06-14 07:46:36 -07:00
Simon Hausmann
142b1ebde7 System Testing: Expose the accessibility role of elements 2024-06-14 07:46:36 -07:00
Simon Hausmann
b7478bb88c Add i-slint-backend-testing to the list of published crates
(also add std to the required features of core, so it compiles out of
the box)
2024-06-14 03:54:56 -07:00