Commit graph

1483 commits

Author SHA1 Message Date
Olivier Goffart
4ad5b1f6d6 Remove the pin of nix 0.26.2 since nix 0.26.4 was released 2023-08-29 18:42:30 +02:00
Simon Hausmann
a98e07417e Add support for a simple event loop with proxy to the testing backend
Moved from the spawn_local test, this allows for re-use in the
show_strongref integration test.
2023-08-28 13:45:28 +02:00
Simon Hausmann
65f9e6f1eb Move the OpenGLInterface back to the FemtoVG renderer
At the moment it's only needed there, so let's
have it there and move it to core later if the need arises.
2023-08-28 13:33:15 +02:00
Simon Hausmann
48063f0df8 Fix Skia OpenGL/Vulkan feature selection
With C++, we would not forward the opengl/vulkan flags to the skia renderer, so
selecting no backend but just the SKIA_RENDERER_OPENGL would end
up merely selecting Skia, not activating the opengl feature.

The renderer features will continue to be delegated to the backend
selector crate, where they will be activated directly in the renderer.
2023-08-28 13:22:33 +02:00
Olivier Goffart
93a8f604a8 linuxkms: update dependencies 2023-08-28 12:04:34 +02:00
Olivier Goffart
c33e5a0f12
Rust platform API: add ways to send CloseRequested and WindowActiveChanged events 2023-08-24 14:39:20 +02:00
Olivier Goffart
541e7137c6
Backends: don't resize the WindowItem in set_visible
We already query the size right after the call to set_visible in the
WindowInner::show()
2023-08-24 13:15:28 +02:00
Olivier Goffart
44a8147201
Rust platform API to query window properties 2023-08-22 18:32:50 +02:00
Olivier Goffart
f100ee48ff Fix alias to externaly modified property not being marked as such
In the case of bug #3318, the implicit alias to the window's height or
width was removed but the propery was not marked as externaly modified,
causing later pass to optimize and inline things that shouldn't

Fixes #3318
2023-08-22 16:20:13 +02:00
Olivier Goffart
25fb6ade76
winit: re-export the winit crate
Such that people that want to use i-slint-backend-winit don't need to
also import the right version of winit from their Cargo.toml and just
can re-use the re-exported version
2023-08-21 17:49:45 +02:00
Simon Hausmann
6dd60113f1 Add some information about the display handle when glutin::display::Display::new() fails
The error from glutin is just a string.

cc #3312
2023-08-21 17:16:55 +02:00
Olivier Goffart
c84a89c4ef Native Style: Fix groupbox with the fusion style 2023-08-17 20:44:51 +02:00
Olivier Goffart
8884ce3565 Native Style: don't call initFrom on QStyleOption
This adds the enabled state which we don't need
2023-08-17 20:44:51 +02:00
Olivier Goffart
244e03a823 Native style: Fix animations
Commit bcbe157712 fixed animations in the
breeze style, but broke other style because it removed the call to
accept() the event
2023-08-17 20:44:51 +02:00
Simon Hausmann
96d7bb132c reuse: remove glob for markdown files
Instead, place the copyright and license right into the source.

To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +02:00
Tobias Hunger
09d3eaf00a Update license symlinks
run `cargo xtask check_reuse_compliance --fix-symlinks`
2023-08-16 11:46:15 +02:00
Simon Hausmann
81a53110c4 Fix window always coming to the front on Ubuntu 20.04 when window properties change
Only call set_window_level if the value changes.

Fixes #3280
2023-08-16 11:29:33 +02:00
Eric
4b9fb89332
add property for slider to support vertical orientation (#3236) 2023-08-16 09:58:50 +02:00
Olivier Goffart
7ec5b01ff0 C++: Properly enable the software renderer when the feature is enabled 2023-08-02 11:57:02 +02:00
Olivier Goffart
bcbe157712 Native style: Fix animations with the KDE's breeze style
The style use update() on an invisible widget so animations wouldn't
work. As a workaround, capture the MetaCall event
2023-08-02 10:56:25 +02:00
Olivier Goffart
5718b15899 Qt platform: use QWindow::requestUpdate instead of QWidget::update
Otherwise we may repaint too fast

Fixes #3193
2023-08-02 10:56:25 +02:00
Simon Hausmann
203a5ed431 linuxkms: Tweak mouse cursor appearance
- Fix the viewbox so that cursor isn't squashed but appears in the
  correct ratio.
- Add a ~2 pixel wide white stroke around it, so that it's easier to see
  on dark background.
2023-07-31 20:11:15 +02:00
Olivier Goffart
f5caafd379 linuxkms: Implement support for SLINT_SCALE_FACTOR 2023-07-31 19:35:17 +02:00
Olivier Goffart
ad389aa4eb linuxkms: Implement keyboard input and clamp mouse
Unfortunately, this is currently not mapped to the right keyboard layout

Also keep the mouse clamped in the visible area.
And make it start in the middle of the screen.
2023-07-31 17:27:53 +02:00
Simon Hausmann
23ca0cb36c Disambiguate Render trait type name
Use FullscreenRenderer as name for the trait used in the linuxkms backend
2023-07-31 17:11:43 +02:00
Simon Hausmann
868173cc20 Disambiguate the type name SkiaRenderer
- Use WinitSkiaRenderer for the adapter in the winit backend (similar to WinitSoftwareRenderer)
- Use SkiaItemRenderer for the impl of the ItemRenderer trait
2023-07-31 17:11:43 +02:00
Simon Hausmann
d96d37ea4b Fix linuxkms on i915
Adding a framebuffer with the given modifiers fails for some reason. Forcing
the gbm surface to linear is one workaround, but instead
let's use the old API without modifiers but still planar support.

This also removes the dependency to drm-ffi again, which was missing from renderer-femtovg.
2023-07-31 13:47:23 +02:00
Simon Hausmann
6b044ae078 Rename extension trait to use Ext as suffix 2023-07-31 13:06:28 +02:00
Simon Hausmann
84ddfc6c2f Add support for rendering the mouse cursor with linuxkms
The cursor is loaded by the window adapter from the cache. When it's
loaded the first time, its format will be Svg, so we convert it to a
pixel buffer. That way the skia backend can convert it on first draw
into a skia_safe::Image and replace the cache entry with the backend
storage variant.
2023-07-31 13:06:28 +02:00
Simon Hausmann
4b2eacd024 Fix build
Amends 717a3d9729
2023-07-31 12:46:58 +02:00
Simon Hausmann
717a3d9729 linuxkms: Add support for planar framebuffers and DRM modifiers 2023-07-31 12:07:33 +02:00
Simon Hausmann
7ff7c2f875 Fix let-else formatting
Nightly now supports it and thus `cargo +nightly fmt` yields a
difference.
2023-07-28 13:43:21 +02:00
Simon Hausmann
fee44f3f7d Add basic support for libseat
This is not dynamic unfortunately, but at least it forwards device access for OpenGL and remove the need to run it as root.
2023-07-28 13:40:37 +02:00
Simon Hausmann
36eaad96ad Add support for terminating the app via ctrl+alt+backspace and ctrl+alt+delete 2023-07-28 13:40:37 +02:00
Simon Hausmann
bf57b32898 Clean up the order of function calls in the event loop
Use the common order of timer update, render, sleep.

This should be equivalent to the previous code.
2023-07-28 13:40:37 +02:00
Simon Hausmann
797de6c6d6 Fix rendering of animations without user input
Update timers before rendering, so that the state is correct.
2023-07-28 13:40:37 +02:00
Simon Hausmann
4991278a2b Improve error propagation when opening DRM devices fails
Print the last error
2023-07-28 13:40:37 +02:00
Luke D. Jones
b907b8f904 linuxkms: iterate over DRI files to find correct device 2023-07-28 13:40:37 +02:00
Simon Hausmann
e40f6c253e linuxkms: Add support for FemtoVG as renderer 2023-07-28 13:40:37 +02:00
Simon Hausmann
236d6ec183 Initial EGL implementation using gbm surfaces 2023-07-28 13:40:37 +02:00
Simon Hausmann
5c9eed62f1 Add a new backend that supports rendering fullscreen with Vulkan
This doesn't require a windowing system, just Linux and Vulkan drivers
that supports the display extensions.

It's called linuxkms as soon this will go beyond Vulkan and also support
EGL and perhaps dumb buffers for software rendering.
2023-07-28 13:40:37 +02:00
Olivier Goffart
3a807e46c1
Renderer feature refactor 2023-07-27 19:11:24 +02:00
Simon Hausmann
f60b2ebde9 Add slint::platform::OpenGLInterface
This allows for the use of the FemtoVG renderer but delegate the GL implementation to the user.
2023-07-27 16:48:57 +02:00
Simon Hausmann
3b29bfe2f6 Change OpenGLContextWrapper to return a generic Error
This is in preparation for making the trait public.
2023-07-27 16:48:57 +02:00
Simon Hausmann
4e7ebdceba Improve zero-size OpenGL surface handling
- Use NonZeroU32 in the OpenGLContextWrapper interface (correct API for the future)
- Don't render zero sized windows with the software renderer and FemtoVG
2023-07-27 16:48:57 +02:00
Olivier Goffart
49485dbf7d SoftwareRenderer: add API to construct and change the buffer type 2023-07-27 14:44:28 +02:00
Tobias Hunger
d47d52bf52 ItemVTable::init(...): Take an ItemRc so that the itan can know where in the Item Tree it is located 2023-07-27 12:04:16 +02:00
Simon Hausmann
af97435463 Replace show()/hide() in the WindowAdapter with set_visible(bool)
This makes for a smaller interface.
2023-07-26 13:53:45 +02:00
Simon Hausmann
f15bc6147e Simplify FemtoVG and Skia renderer APIs: remove resize()
We can convey the new physical window size from the run-time
through the private renderer API
when a window resize event is dispatched.
2023-07-25 19:33:26 +02:00
Simon Hausmann
7649153b3e janitor: silence rust warning 2023-07-25 17:58:46 +02:00