slint-ui 1.10.0-nightly.2025020414 → 1.10.0-nightly.2025020617
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +4 -4
- package/package.json +7 -7
- package/rust/interpreter/component_instance.rs +6 -6
- package/rust/lib.rs +9 -1
package/Cargo.toml
CHANGED
|
@@ -41,10 +41,10 @@ accessibility = ["slint-interpreter/accessibility"]
|
|
|
41
41
|
[dependencies]
|
|
42
42
|
napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
|
|
43
43
|
napi-derive = "2.14.0"
|
|
44
|
-
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
45
|
-
i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
46
|
-
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "
|
|
47
|
-
slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
44
|
+
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "5356fdcf89ec17d14b4cadcffb7a17166379ec91", version = "=1.10.0", default-features = false }
|
|
45
|
+
i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "5356fdcf89ec17d14b4cadcffb7a17166379ec91", version = "=1.10.0", default-features = false }
|
|
46
|
+
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "5356fdcf89ec17d14b4cadcffb7a17166379ec91", version = "=1.10.0", default-features = false }
|
|
47
|
+
slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "5356fdcf89ec17d14b4cadcffb7a17166379ec91", version = "=1.10.0"}
|
|
48
48
|
spin_on = { version = "0.1" }
|
|
49
49
|
css-color-parser2 = { version = "1.0.1" }
|
|
50
50
|
itertools = { version = "0.14" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slint-ui",
|
|
3
|
-
"version": "1.10.0-nightly.
|
|
3
|
+
"version": "1.10.0-nightly.2025020617",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"homepage": "https://github.com/slint-ui/slint",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@napi-rs/cli": "2.18.4"
|
|
67
67
|
},
|
|
68
68
|
"optionalDependencies": {
|
|
69
|
-
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.10.0-nightly.
|
|
70
|
-
"@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.10.0-nightly.
|
|
71
|
-
"@slint-ui/slint-ui-binary-darwin-x64": "1.10.0-nightly.
|
|
72
|
-
"@slint-ui/slint-ui-binary-darwin-arm64": "1.10.0-nightly.
|
|
73
|
-
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.10.0-nightly.
|
|
74
|
-
"@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.10.0-nightly.
|
|
69
|
+
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.10.0-nightly.2025020617",
|
|
70
|
+
"@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.10.0-nightly.2025020617",
|
|
71
|
+
"@slint-ui/slint-ui-binary-darwin-x64": "1.10.0-nightly.2025020617",
|
|
72
|
+
"@slint-ui/slint-ui-binary-darwin-arm64": "1.10.0-nightly.2025020617",
|
|
73
|
+
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.10.0-nightly.2025020617",
|
|
74
|
+
"@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.10.0-nightly.2025020617"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -46,7 +46,7 @@ impl JsComponentInstance {
|
|
|
46
46
|
|
|
47
47
|
#[napi]
|
|
48
48
|
pub fn set_property(&self, env: Env, prop_name: String, js_value: JsUnknown) -> Result<()> {
|
|
49
|
-
let ty = self
|
|
49
|
+
let (ty, _) = self
|
|
50
50
|
.inner
|
|
51
51
|
.definition()
|
|
52
52
|
.properties_and_callbacks()
|
|
@@ -88,7 +88,7 @@ impl JsComponentInstance {
|
|
|
88
88
|
prop_name: String,
|
|
89
89
|
js_value: JsUnknown,
|
|
90
90
|
) -> Result<()> {
|
|
91
|
-
let ty = self
|
|
91
|
+
let (ty, _) = self
|
|
92
92
|
.inner
|
|
93
93
|
.definition()
|
|
94
94
|
.global_properties_and_callbacks(global_name.as_str())
|
|
@@ -121,7 +121,7 @@ impl JsComponentInstance {
|
|
|
121
121
|
) -> Result<()> {
|
|
122
122
|
let function_ref = RefCountedReference::new(&env, callback)?;
|
|
123
123
|
|
|
124
|
-
let ty = self
|
|
124
|
+
let (ty, _) = self
|
|
125
125
|
.inner
|
|
126
126
|
.definition()
|
|
127
127
|
.properties_and_callbacks()
|
|
@@ -188,7 +188,7 @@ impl JsComponentInstance {
|
|
|
188
188
|
) -> Result<()> {
|
|
189
189
|
let function_ref = RefCountedReference::new(&env, callback)?;
|
|
190
190
|
|
|
191
|
-
let ty = self
|
|
191
|
+
let (ty, _) = self
|
|
192
192
|
.inner
|
|
193
193
|
.definition()
|
|
194
194
|
.global_properties_and_callbacks(global_name.as_str())
|
|
@@ -283,7 +283,7 @@ impl JsComponentInstance {
|
|
|
283
283
|
callback_name: String,
|
|
284
284
|
callback_arguments: Vec<JsUnknown>,
|
|
285
285
|
) -> Result<JsUnknown> {
|
|
286
|
-
let ty = self
|
|
286
|
+
let (ty, _) = self
|
|
287
287
|
.inner
|
|
288
288
|
.definition()
|
|
289
289
|
.properties_and_callbacks()
|
|
@@ -321,7 +321,7 @@ impl JsComponentInstance {
|
|
|
321
321
|
callback_name: String,
|
|
322
322
|
callback_arguments: Vec<JsUnknown>,
|
|
323
323
|
) -> Result<JsUnknown> {
|
|
324
|
-
let ty = self
|
|
324
|
+
let (ty, _) = self
|
|
325
325
|
.inner
|
|
326
326
|
.definition()
|
|
327
327
|
.global_properties_and_callbacks(global_name.as_str())
|
package/rust/lib.rs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
mod interpreter;
|
|
5
5
|
use std::path::PathBuf;
|
|
6
|
+
use std::sync::LazyLock;
|
|
6
7
|
|
|
7
8
|
pub use interpreter::*;
|
|
8
9
|
|
|
@@ -14,6 +15,8 @@ use napi::{Env, JsFunction, JsObject};
|
|
|
14
15
|
#[macro_use]
|
|
15
16
|
extern crate napi_derive;
|
|
16
17
|
|
|
18
|
+
static IS_WAYLAND: LazyLock<bool> = LazyLock::new(|| std::env::var("WAYLAND_DISPLAY").is_ok());
|
|
19
|
+
|
|
17
20
|
#[napi]
|
|
18
21
|
pub fn mock_elapsed_time(ms: f64) {
|
|
19
22
|
i_slint_core::tests::slint_mock_elapsed_time(ms as _);
|
|
@@ -32,8 +35,13 @@ pub enum ProcessEventsResult {
|
|
|
32
35
|
|
|
33
36
|
#[napi]
|
|
34
37
|
pub fn process_events() -> napi::Result<ProcessEventsResult> {
|
|
38
|
+
// Using std::time::Duration::Zero with the winit backend in wayland causes slint to consume 100% of a cpu core
|
|
39
|
+
// https://github.com/slint-ui/slint/issues/5780
|
|
40
|
+
let min_timeout = std::time::Duration::from_millis(16);
|
|
41
|
+
let timeout = if *IS_WAYLAND { min_timeout } else { std::time::Duration::ZERO };
|
|
42
|
+
|
|
35
43
|
i_slint_backend_selector::with_platform(|b| {
|
|
36
|
-
b.process_events(
|
|
44
|
+
b.process_events(timeout, i_slint_core::InternalToken)
|
|
37
45
|
})
|
|
38
46
|
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
|
39
47
|
.and_then(|result| {
|