Commit graph

1507 commits

Author SHA1 Message Date
J-P Nurmi
f8ed10b092 Qt: non-uniform border radius 2024-02-06 18:01:35 +01:00
Simon Hausmann
99d87934c0 Fix build with --cfg=web_sys_unstable_apis
Amends fadcbdf726
2024-02-05 11:50:09 +01:00
Olivier Goffart
0db6e96f67 Update version number in android docs 2024-02-04 13:03:37 +01:00
Simon Hausmann
858ed639ec
Fix Android build on Windows (#4530)
- Use Path/OsStr to avoid directory separator mismatches
- Call d8.bat

Fixes #4524
2024-02-02 14:56:00 +01:00
Olivier Goffart
fadcbdf726 Android: send the input type to the input method
Also avoid flickering of the input method when inserting text by
preventing sending an imput method event right after deleting the
selection
2024-02-02 11:54:47 +01:00
Olivier Goffart
41f1f41536 Qt: fix crash when closing the popup window on wayland
Fixes #4500

When the WindowAdaptor is dropped, deleteLater is used on the C++ QWidget.
On wayland, we still recieve a mouse exit event when the widget is about
to be deleted. This calls a callback into the deleted Rust WindowAdaptor.
2024-02-01 09:31:08 +01:00
Olivier Goffart
46dd8b1060 Android: refactor the JavaHelper to avoid that each function has unsafe 2024-01-31 14:56:42 +01:00
Olivier Goffart
d76631431e Android: Split the backend into modules
lib.rs started to be a bit big
2024-01-31 14:56:42 +01:00
Olivier Goffart
fb78bbd702 Android: Don't draw the UI under the system bars or the keyboard 2024-01-31 09:20:19 +01:00
Olivier Goffart
0f14b24cc6 janitor: android: fix warnings and group args together 2024-01-30 18:08:06 +01:00
Olivier Goffart
a9641a2d11 Update version number in the android readme 2024-01-30 15:26:02 +01:00
Olivier Goffart
fa24283cd4 Add a few funciton to make SlintContext usefull
Make it possible to spawn future and run event loop with a SlintContext
handle
2024-01-29 15:34:48 +01:00
Simon Hausmann
13b93a4af1 winit: Change window activation to default to false on for HTML canvas usage
Don't activate the canvas by default, as that causes winit to call focus() on the DOM element, which in turn will forcibly scroll the browser window.
That means any existing anchors are ignored and the user's scroll preference is disturbed.

Fixes #4431
2024-01-29 14:20:55 +01:00
Olivier Goffart
25925b55fd android: detect dark or light style 2024-01-26 15:26:21 +01:00
Olivier Goffart
daa376becd Fix linuxkms compilation and warnings when no features are enabled
Remove a lot of error in rust-analyzer when opening the slint workspace
2024-01-26 13:47:14 +01:00
Olivier Goffart
83adb467c0 Only depends on i-slint-backend-linuxkms on linux, even if the feature is enabled
This allows to simplify the npm build as well
2024-01-26 13:46:11 +01:00
Simon Hausmann
93142bf417 winit: Always make skia-opengl available
The Skia OpenGL renderer is portable and sometimes esp. on Windows produces better results, so make it always available as an open if `renderer-skia` is enabled. `renderer-skia-opengl` continues to select the GL renderer as default.
2024-01-24 18:20:04 +01:00
Olivier Goffart
573d4a3b50 Remove the test function for sending double_click
They are not commonly used so no need to use semi-public api for that
and it's really easy to similate with ust two clicks anyway

The previous test function were added before there was public way to
send events
2024-01-24 10:20:06 +01:00
Olivier Goffart
9113b877bd winit: avoid to poll or call request_redraw too often
Otherwise there will be a huge queue of request redraw command that
accumulate within winit.
This makes operation such as resizing a bit more soomth

Tested on X11
2024-01-22 19:22:16 +01:00
Olivier Goffart
168654fa29 Android: Implement InputConnection
So that we can use text prediction and other input method features
2024-01-21 09:21:41 +01:00
Olivier Goffart
daa40f43cd Android: Use java code to show or hide the keyboard
instead of coding it all in JNI

This uses build.rs to compile the java code into bytecode that is then
embedded in the binary and loaded at runtime
2024-01-21 09:21:41 +01:00
Simon Hausmann
5e23dbe765 Fix reuse compliance check
Current versions of the reuse tool don't allow inline copyright and licsense information in SVG and CSV files anymore. Move those into the dep5 file.
2024-01-18 15:11:43 +01:00
Olivier Goffart
f1f141896f
Fix linear gradiant rendering in non square rectangle
Fixes https://github.com/slint-ui/slint/issues/3730
2024-01-17 17:44:51 +01:00
Simon Hausmann
d9ddc865c2 Fix panic when shutting down process on Linux
Commit 41bfe66447 bumped accesskit
dependencies, which introduced a version that uses threads.

That means the action handler as well as the initial tree update source
closure are destroyed in a thread that's not the ui thread. That means
we destruct a SenderWrapper<Weak<WinitWindowAdapter>> in a thread that
is not the same as the one the wrapper was created in, which causes
Drop for SendWrapper to panic.

Replace the use of SendWrapper here with safely copyable window ids.
2024-01-17 17:07:38 +01:00
Simon Hausmann
199c761583 LinuxKMS: Fix animations using the wrong start time when invoked from invoke_from_event_loop
The event loop roughly loops like this:

loop {
    update_timers_and_animations();
    render();
    sleep_or_dispatch_events();
}

sleep_or_dispatch_events() will wake up when we receive a queued callback from invoke_from_event_loop, and we would
run the callback right away. If that callback sets animated properties, the start time for animations would be incorrect, as we haven't called update_timers_and_animations() yet.

So instead, let's keep track of any received callbacks per sleep cycle, update the animation tick, and then invoke the callbacks.
2024-01-15 18:30:49 +01:00
Simon Hausmann
8caa5acd30 winit: Avoid warnings about exiting fullscreen mode when compiled for the web
We call set_fullscreen(None) on startup for windows that aren't fullscreen (normally), and winit compiled for the web unconditionally calls canvas.exitFullscreen(), which
may produces warnings about exitFullscreen()
being called when not in fullscreen mode.
2024-01-15 15:22:15 +01:00
Simon Hausmann
9c247553e1 LinuxKMS: Tweak the output shown after SLINT_{DRM,VULKAN}_{MODE,OUTPUT,DISPLAY}=list to mention the environment variable in question
As suggested by Olivier, this makes it much clearer what the next steps
are.
2024-01-12 17:32:56 +01:00
Simon Hausmann
4d23bcdd97 LinuxKMS: Replace the use of panic with eprintln/std::process::exit
As suggested by Olivier, That's a little cleaner than panicing. There's
no reason to panic, this is normal :-)
2024-01-12 17:32:56 +01:00
Simon Hausmann
2b699c2189 LinuxKMS: Add support for selecting display modes with DRM output 2024-01-12 17:32:56 +01:00
Simon Hausmann
bf7a4095ad LinuxKMS: Not only print the name of the renderer, also print the resolution 2024-01-12 16:07:29 +01:00
Simon Hausmann
4d58c9877d LinuxKMS: Remove set_event_loop_quit_on_last_window_closed implementation
This is now handled in i-slint-core.

Amends 9ff13faee8
2024-01-12 10:05:02 +01:00
Olivier Goffart
a7934438ad Janitor: update some dependencies 2024-01-11 14:01:19 +01:00
Simon Hausmann
e1c5f4ff03 linuxkms: Fix support for "refresh_full_speed" in SLINT_DEBUG_PERFORMANCE
We trigger update_timers_and_animations() every time the event loop wakes up.
If there's a real animation in the UI going on, that'll also trigger a
request_redraw() call and all will be well.

But when the only source of animation is set_has_active_animations() from
RenderingMetricsCollector, then we might end up in a situation where the event
loop is woken up before the rendered frame is on the screen, which means we
invoke update_timers_and_animations(), but we won't render because the
previous frame isn't shown yet. When it is shown and our presentation callback
is invoked, has_active_animations() is false again.

So instead, remember if we need to re-render once after rendering()
and use that to decide if we need to re-render in the presentation callback.
2024-01-11 11:23:18 +01:00
Daniel
807a233849
feat: Add Key.Space to Key namespace. (#4311) 2024-01-10 16:25:31 +01:00
Olivier Goffart
926c313493
Android docs: Fix warning in the documentation 2024-01-10 10:45:28 +01:00
Olivier Goffart
afb8a66603 Qt backend: Check if platform supports the selection clipboard
Suppress console warning on Windows:
`Data set on unsupported clipboard mode. QMimeData object will be
deleted.`

Fixes #3206
2024-01-10 10:11:05 +01:00
Olivier Goffart
0725bb1b61
Android docs: mention the todo example 2024-01-10 10:06:15 +01:00
Simon Hausmann
438b9afeaa
Reduce WindowAdapter API slightly (#4304)
Move the set_fullscreen function added to the WindowAdapter trait in 779aff0b39
to be a function in WindowProperties instead.
That way it'll be easier in the future to extend this with other window states without
having to modify or break the WindowAdapter trait API.
2024-01-09 18:55:06 +01:00
Harold
779aff0b39
Added set_fullscreen API to WindowAdapter. (#4286)
See #3283
2024-01-09 15:23:23 +01:00
Olivier Goffart
9ff13faee8 Implement the quitting on windows close in i-slint-core and not in the platform
Step towards #1499
2024-01-08 21:17:52 +01:00
Olivier Goffart
b5032ca53f winit: add a hook to adjust the winit::WindowBuilder
This is still internal API but can help for the case of
https://github.com/slint-ui/slint/discussions/4284 where this could be
used to call winit::WindowBuilder::with_titlebar_transparent or others
https://docs.rs/winit/latest/x86_64-apple-darwin/winit/platform/macos/trait.WindowBuilderExtMacOS.html#tymethod.with_title_hidden
2024-01-08 15:17:34 +01:00
Simon Hausmann
a7d1ab89d7 Minor cleanup
Merge two functions that had only one call site.
2024-01-08 09:56:14 +01:00
Simon Hausmann
982b4c806f LinuxKMS: Add initial support for software rendering with Skia
This is the initial implementation based on DRM dumb buffers,
which cleans up various things at the same time:

 - DRM output is separate from GBM and DRM dumb buffer displays.
   The latter two re-use the former.
 - The timer refresh for the Vulkan KHR Display rendering lives
   now with the KHR display code, in hope to be replaced with a
   better mechanism in the future.

What's missing still is support for partial updates as well as
rendering with our own software renderer.
2024-01-07 11:54:29 +01:00
Simon Hausmann
c5aebcfde3 Fix close behaviour of PopupWindow
- Close on release when the mouse pointer is inside the popup
- Close on press when click is outside
2024-01-06 10:45:34 +01:00
Olivier Goffart
b90047599e Android: Fix delete and backspace being inverted 2024-01-05 17:35:49 +01:00
Olivier Goffart
950ffb0041 Android: make the show/hide keyboard work with native-activity 2024-01-05 16:11:28 +01:00
Olivier Goffart
f495235b74 Android todo example: cleanup console output and remove warning 2024-01-05 16:11:28 +01:00
Simon Hausmann
8193d4d064 LinuxKMS: Clean up internal page flip callback API
Remove the hack of calling present() from our swap_buffers() forwarder (and let it really only forward),
and instead call it explicitly through the shared egl_display member.
The way we can pass along the callback instead of storing it separately.
2024-01-04 10:35:40 +01:00
Simon Hausmann
f5bf6e5dc0 Skia: Clean up pre present notify callback API
Move this back out of render() again and make it stateful in the renderer. Reduces the amount of book-keeping required and it's always the same callback anyway.
2024-01-04 10:35:09 +01:00
Simon Hausmann
41bfe66447 Bump AccessKit dependencies
This brings lazy initialization of the accesskit adapter on Linux/dbus.

cc #3867
2024-01-04 10:00:55 +01:00