Commit graph

1507 commits

Author SHA1 Message Date
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
Simon Hausmann
a2e10f8c78 When trying to fetch an ElementHandle as part of a RPC, remove the tracked handle if it's not valid anymore
There's no value in keeping it.
2024-06-13 04:03:17 -07:00
Simon Hausmann
1c6aadeb30 Add support for setting the accessible value 2024-06-13 04:03:17 -07:00
Simon Hausmann
e071ba9e5b Add a way to invoke accessibility actions 2024-06-13 04:03:17 -07:00
Simon Hausmann
97343b22db Testing: Add the ability to locate elements by id and expose various properties 2024-06-13 04:03:17 -07:00
Simon Hausmann
4591ad8d57 Add plumbing for system testing 2024-06-13 04:03:17 -07:00
Simon Hausmann
319fa0381c
Doc: Fix stray backtick 2024-06-13 06:33:30 +02:00
Simon Hausmann
9c75009910 LinuxKMS: Fix build with just the software renderer
We don't need gbm, but at least the drm crate.
2024-06-11 17:35:52 +02:00
Simon Hausmann
97df6b1be1 Mark AccessibleRole as non-exhaustive
That way we can add new variants in the future, while still exporting this in our public API.
2024-06-11 08:02:10 -07:00
Simon Hausmann
0347aae66b Add ElementHandle::accessible_role()
This allows querying for elements by their role/type.
2024-06-11 08:02:10 -07:00
Olivier Goffart
58826ddd94 Testing C++ API: add a visitor over the ElementHandle 2024-06-10 15:52:40 +02:00
Simon Hausmann
028903c2d3 LinuxKMS: Add support for partial rendering with the Slint software renderer 2024-06-10 06:01:19 -07:00
Simon Hausmann
27e9b133c9 LinuxKMS: Improve error reporting when failing to initialize any renderer
Collect the errors and print the lot of them.
2024-06-10 06:01:19 -07:00
Simon Hausmann
03b6a055e9 LinuxKMS: Initial support for rendering with the Slint software renderer
Two features are still missing:
 - mouse cursor support
 - partial rendering
2024-06-10 06:01:19 -07:00
Olivier Goffart
318c80b4f2 testing: only visit items that are visible and not fully clipped 2024-06-07 15:08:44 +02:00
Olivier Goffart
a780dd4905 Testing: Fix duplicated accessibility element
This fix the C++ todo test that wasn't run because of a typo

When an element is optimized in another one, only the first one should
report the accessible properties. (because element with accessible
properties cannot be optimized so they are always the first)
2024-06-07 13:18:12 +02:00
Simon Hausmann
0e67654431 Fix jitter when resizing a window on macOS
Commit 1e450abc9c originally fixed this. Meanwhile, after many refactorings, this doesn't work anymore for the FemtoVG renderer. That's because the contents placement (or layer's contents gravity) is set before the hidden layer NSOpenGLContext creates is associated with the view.

For the Skia GL surface that already works, but for clarify the code is moved into the same location.

For Skia Metal rendering, apply the same on the metal layer (through the view). For this to work the contents scale also needs to be applied. To avoid further visual effects, the scale needs to be applied as early as possible, so apply it right after creating the
surface and latest at rendering time.

Fixes #5258
2024-06-06 08:34:58 -07:00
Olivier Goffart
e9deb00332 Testing API: Have a public rust visitor function 2024-06-06 16:12:53 +02:00
Olivier Goffart
ec0ddbc5b9 Add missing license header from previous commit 2024-06-06 11:18:15 +02:00
Luc Fauvel
44a537d902
Implemented resizing for non-decorated winit windows (#5026)
Fixes #5023

* Implemented resizing for non-decorated winit windows

* Fixed formatting

* Changed direction match to use a tuple, reduced resize border size, returned after handling resize

* Added is resizable check for before resizing winit window

* Added resize-border property to window

* Formatted code

* Change resize-border from float to length
2024-06-06 11:17:05 +02:00
Arnold Loubriat
8ece16321b Add DefaultActionVerb to AccessKit nodes 2024-06-06 00:01:29 -07:00
Simon Hausmann
28cff6628d Add a test for looking up elements by id that are conditional 2024-06-05 09:51:13 -07:00
Simon Hausmann
15b517a554 Emit a warning to stderr (debug_log) when using the ElementHandle API but there's no debug info present 2024-06-05 01:29:58 -07:00
Simon Hausmann
622991a627 Fix ElementHandle::find_by_element_id docs
Describe what an id is and provide an example.
2024-06-05 01:29:58 -07:00
Simon Hausmann
7af0e7ae7c Add C++ API for find_by_element_type_name 2024-06-05 01:29:58 -07:00
Simon Hausmann
1a8ce3c659 Add support for optimized rectangles in ElementHandle
Keep merging elements, but remember the boundaries in the debug info, separated by a slash.

Also fixed tests that rely on accessible-label being set only once. For example

```
Button { text: "foo"; }
```

will certainly have "foo" as accessible-label on `Button`, but its internal `Text` element has
an implicit "accessible-label" set to the same
value.

So don't rely on that for now but search by id instead.
2024-06-05 01:29:58 -07:00
Simon Hausmann
a752851d0f Expose element type names and ids in Rust and C++ 2024-06-05 01:29:58 -07:00