Commit graph

577 commits

Author SHA1 Message Date
DataTriny
2de3b9d455 Add the accessible-enabled property 2024-10-25 10:20:09 +02:00
Simon Hausmann
7e3747041f Fix simulator build
Amends ac9b85049a
2024-10-23 19:18:57 +02:00
Ian Hattendorf
3cc44dc670 Add version to OpenGLAPI 2024-10-23 11:13:49 +02:00
Ian Hattendorf
97927ccee9 Don't allow fallback in PlatformBuilder
If we're explicitly requesting a platform with specific properties, we
should fail to allow the caller to react accordingly.
2024-10-23 11:13:49 +02:00
Ian Hattendorf
ac9b85049a Add PlatformBuilder API to allow selecting OpenGL API
Right now this just allows selecting between OpenGL and OpenGL ES.
2024-10-23 11:13:49 +02:00
DataTriny
28b5a67583 Implement accessible-delegate-focus for the AccessKit backend 2024-10-22 12:54:00 +02:00
DataTriny
be62567293 Tell AccessKit that ListItems can be focused 2024-10-21 07:13:07 +02:00
Arnold Loubriat
4621739cba Implement selectable and selected properties in the AccessKit accessibility backend 2024-10-16 15:38:46 +02:00
Tobias Hunger
df4f9b38ee femtovg: Fix warning about deprecated web_sys::set_fill_style
Use set_fill_style_str insterad, it avoids constructing a JSValue
from a str.
2024-10-16 13:25:00 +02:00
Enyium
054035d930 Set icon also as big winit window icon for increased compatibility (Windows-only).
Under Windows, the big icon is shown at least in the ancient Alt+Tab dialog, which can be restored via registry tweak.
2024-10-04 15:28:08 +02:00
Olivier Goffart
785c16c71a bring_to_front should un-minimize the window
This helps for bringing the preview window back from minimized state
when clicking on "show preview" on X11
2024-10-04 10:06:02 +02:00
Simon Hausmann
f772cb8e11
live-preview: Bring the window to the front and focus it when the use… (#6295)
Fixes #196


Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-09-24 17:05:03 +02:00
Tobias Hunger
d1420969c7 winit: Quieten warning
I am getting this warning:

```
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
warning: missing documentation for a function
  --> internal/backends/winit/lib.rs:83:1
   |
83 | / pub fn create_gl_window_with_canvas_id(
84 | |     canvas_id: &str,
85 | | ) -> Result<Rc<dyn WindowAdapter>, PlatformError> {
   | |_________________________________________________^
   |
note: the lint level is defined here
  --> internal/backends/winit/lib.rs:6:9
   |
6  | #![warn(missing_docs)]
   |         ^^^^^^^^^^^^
```

Fix this by adding a tiny bit of documentation
2024-09-18 18:45:14 +02:00
crai0
3f3ac7e347
common: add support for back and forward pointing-device buttons (#6149)
Closes #6043

ChangeLog: add support for back and forward pointing-device buttons
2024-09-18 07:48:30 +02:00
Simon Hausmann
c1863072a8 winit: Clean up backend creation API
Use a builder pattern, which also allows configuring the event loop builder.

Fixes #6103

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-09-16 10:11:00 +02:00
Simon Hausmann
a9cb255906 winit: Rename window_builder_hook to window_attributes_hook
In winit the WindowBuilder was renamed to WindowAttributes.
2024-09-16 10:11:00 +02:00
Arnold Loubriat
f01420258f Changelog: Introduce AccessibleRole::ListItem 2024-09-16 09:15:39 +02:00
Arnold Loubriat
54992477d8 Changelog: Fix AccessKit role mapping for AccessibleRole::List 2024-09-16 09:15:39 +02:00
Simon Hausmann
d74e49e71f Skia renderer: Remove unnecessary scale factor argument / function 2024-09-10 10:24:07 +02:00
Simon Hausmann
204cf7d0db Fix wasm build 2024-08-28 21:24:42 +02:00
Simon Hausmann
394f1f0f91 Remove unused function 2024-08-28 21:24:42 +02:00
Simon Hausmann
16f47eac7d Disable the macOS system menu bar for the Slint Live-Preview
Fixes #5962
2024-08-28 21:24:42 +02:00
Tobias Hunger
e01da55c22 winit: Suppress warnings when building for WASM
I am not happy with the `allow(unused)`, but putting
`cfg(not(target_family = "wasm"))` was getting out of
hand.
2024-08-14 15:55:49 +02:00
Tobias Hunger
58e85ef317 winit: Suppress warning about web_sys_unstable_api cfg
This is supposed to be set via `RUST_FLAGS` by users of our crate,
so allow it in `cfg`.
2024-08-14 15:55:49 +02:00
Olivier Goffart
666a892fa6
winit: Don't forward synthetic event to the application
Fixes #5823
2024-08-12 14:37:38 +02:00
Simon Hausmann
11ce002314 macOS: Fix windows not resizing/redrawing correctly when showing again after calling hide
Don't assume that any pending redraw request will be delivered when the window his shown/hidden.

Amends 9113b877bd

Fixes #5658
2024-07-23 13:35:35 +02:00
Simon Hausmann
28f7ee7c7d winit: Prefer X11 over Wayland when running in WSL
This is a workaround for the compositor on WSL tending to crash.
Unfortunately we can't just try to create an event loop with x11 first
and then re-try with wayland, winit doesn't allow that. So just avoid
wayland for now.

The long term solution #5667

Fixes #5657
2024-07-22 14:12:14 +02:00
Simon Hausmann
0be2d4521e API Review: Remove suspend/resume related functions from FemtoVG renderer
This could've been `set_opengl_context` taking an `Option`, but it turns
out that makes for an awkward interface when wanting to pass None,
because that also then requires a dummy type for the OpenGL context even
though none is wanted.
2024-07-08 12:23:56 +02:00
Simon Hausmann
89b80eb00e API review: move {window,display}_handle_06_rc() into WindowAdapterInternal 2024-07-05 20:48:02 +02:00
Olivier Goffart
7c93c7438b Rename resize-border => resize-border-width 2024-07-05 12:50:16 +02:00
Noah Sweilem
6095398374
Winit window event filter (#5531)
* Add winit window event filter (#3066)

* Winit window event filter changelog entry

* Format fixes

* More format fixes

* Make requested changes

- Callback gets a ref to the Slint window
- Callback returns an enum
- Callback is no longer `Send`

* Format fixes

* More format fixes

* Merge conflict fixes

* Rename members of `WinitWindowEventResult`

Closes #3066
2024-07-04 17:41:57 +02:00
Simon Hausmann
1ab68d53ed winit: remove unnecessary helper function to access winit window 2024-07-03 18:01:48 +02:00
Simon Hausmann
cc1038baf8 Oops, fix non-wasm build 2024-07-03 16:06:47 +02:00
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
1baf227e9e Update AccessKit 2024-07-02 11:45:46 +02:00
Tobias Hunger
dbde3c2f9e janitor: Remove unused variable warning in winit 2024-06-28 18:59:01 +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
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
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
83e7f8c6af Fix wasm build 2024-06-18 17:48:17 +02:00