fix(sctk): popup initial configure ack handling
This commit is contained in:
parent
8cfe449315
commit
686c6afb8d
7 changed files with 68 additions and 45 deletions
69
Cargo.lock
generated
69
Cargo.lock
generated
|
|
@ -1316,8 +1316,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-text"
|
name = "cosmic-text"
|
||||||
version = "0.16.0"
|
version = "0.18.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-text.git#ee702e50901d90cd842dbd88154687bd2512b52c"
|
source = "git+https://github.com/pop-os/cosmic-text.git#cd1d3aa1efb7d5529fb9de09d37fbc85b8ce1253"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"fontdb",
|
"fontdb",
|
||||||
|
|
@ -1325,10 +1325,10 @@ dependencies = [
|
||||||
"linebender_resource_handle",
|
"linebender_resource_handle",
|
||||||
"log",
|
"log",
|
||||||
"rangemap",
|
"rangemap",
|
||||||
"rustc-hash 1.1.0",
|
"rustc-hash 2.1.1",
|
||||||
"self_cell",
|
"self_cell",
|
||||||
"skrifa 0.39.0",
|
"skrifa 0.40.0",
|
||||||
"smol_str 0.2.2",
|
"smol_str",
|
||||||
"swash",
|
"swash",
|
||||||
"sys-locale",
|
"sys-locale",
|
||||||
"unicode-bidi",
|
"unicode-bidi",
|
||||||
|
|
@ -1980,6 +1980,15 @@ dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "font-types"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1e4d2d0cf79d38430cc9dc9aadec84774bff2e1ba30ae2bf6c16cfce9385a23"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fontconfig-parser"
|
name = "fontconfig-parser"
|
||||||
version = "0.5.8"
|
version = "0.5.8"
|
||||||
|
|
@ -2654,14 +2663,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "harfrust"
|
name = "harfrust"
|
||||||
version = "0.4.1"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0caaee032384c10dd597af4579c67dee16650d862a9ccbe1233ff1a379abc07"
|
checksum = "4f9f40651a03bc0f7316bd75267ff5767e93017ef3cfffe76c6aa7252cc5a31c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"core_maths",
|
"core_maths",
|
||||||
"read-fonts 0.36.0",
|
"read-fonts 0.37.0",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -3006,7 +3015,7 @@ dependencies = [
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash 2.1.1",
|
||||||
"serde",
|
"serde",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"web-time",
|
"web-time",
|
||||||
"window_clipboard",
|
"window_clipboard",
|
||||||
|
|
@ -5355,18 +5364,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358"
|
checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"font-types",
|
"font-types 0.10.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "read-fonts"
|
name = "read-fonts"
|
||||||
version = "0.36.0"
|
version = "0.37.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5eaa2941a4c05443ee3a7b26ab076a553c343ad5995230cc2b1d3e993bdc6345"
|
checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"core_maths",
|
"core_maths",
|
||||||
"font-types",
|
"font-types 0.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -6053,12 +6062,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "skrifa"
|
name = "skrifa"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c9eb0b904a04d09bd68c65d946617b8ff733009999050f3b851c32fb3cfb60e"
|
checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"read-fonts 0.36.0",
|
"read-fonts 0.37.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -6199,12 +6208,6 @@ dependencies = [
|
||||||
"futures-lite",
|
"futures-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "smol_str"
|
|
||||||
version = "0.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smol_str"
|
name = "smol_str"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
|
|
@ -8451,7 +8454,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.3",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-android",
|
"winit-android",
|
||||||
"winit-appkit",
|
"winit-appkit",
|
||||||
|
|
@ -8475,7 +8478,7 @@ dependencies = [
|
||||||
"dpi",
|
"dpi",
|
||||||
"ndk",
|
"ndk",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-core",
|
"winit-core",
|
||||||
]
|
]
|
||||||
|
|
@ -8496,7 +8499,7 @@ dependencies = [
|
||||||
"objc2-core-video",
|
"objc2-core-video",
|
||||||
"objc2-foundation 0.3.2",
|
"objc2-foundation 0.3.2",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-common",
|
"winit-common",
|
||||||
"winit-core",
|
"winit-core",
|
||||||
|
|
@ -8510,7 +8513,7 @@ dependencies = [
|
||||||
"memmap2 0.9.9",
|
"memmap2 0.9.9",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-core",
|
"winit-core",
|
||||||
"x11-dl",
|
"x11-dl",
|
||||||
|
|
@ -8527,7 +8530,7 @@ dependencies = [
|
||||||
"dpi",
|
"dpi",
|
||||||
"keyboard-types",
|
"keyboard-types",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"web-time",
|
"web-time",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -8542,7 +8545,7 @@ dependencies = [
|
||||||
"orbclient",
|
"orbclient",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"redox_syscall 0.7.0",
|
"redox_syscall 0.7.0",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-core",
|
"winit-core",
|
||||||
]
|
]
|
||||||
|
|
@ -8561,7 +8564,7 @@ dependencies = [
|
||||||
"objc2-foundation 0.3.2",
|
"objc2-foundation 0.3.2",
|
||||||
"objc2-ui-kit",
|
"objc2-ui-kit",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-common",
|
"winit-common",
|
||||||
"winit-core",
|
"winit-core",
|
||||||
|
|
@ -8583,7 +8586,7 @@ dependencies = [
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.3",
|
||||||
"sctk-adwaita",
|
"sctk-adwaita",
|
||||||
"smithay-client-toolkit 0.20.0",
|
"smithay-client-toolkit 0.20.0",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
|
|
@ -8606,7 +8609,7 @@ dependencies = [
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
|
|
@ -8624,7 +8627,7 @@ dependencies = [
|
||||||
"cursor-icon",
|
"cursor-icon",
|
||||||
"dpi",
|
"dpi",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
|
|
@ -8645,7 +8648,7 @@ dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.3",
|
||||||
"smol_str 0.3.2",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"winit-common",
|
"winit-common",
|
||||||
"winit-core",
|
"winit-core",
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ tester = ["iced/tester"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
iced.workspace = true
|
iced.workspace = true
|
||||||
iced.features = ["tokio", "debug", "time-travel", "winit", "wgpu"]
|
iced.features = ["tokio", "debug", "time-travel", "winit", "wgpu", "wayland"]
|
||||||
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
|
||||||
|
|
@ -945,11 +945,14 @@ async fn run_instance<P>(
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some((id, mut window)) =
|
let Some((id, mut window)) =
|
||||||
window_manager.get_mut_alias(window_id)
|
window_manager.get_mut_alias(window_id)
|
||||||
else {
|
else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
if !window.state.ready {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// XX must force update to corner radius before the surface is committed.
|
// XX must force update to corner radius before the surface is committed.
|
||||||
#[cfg(feature = "wayland")]
|
#[cfg(feature = "wayland")]
|
||||||
if window.surface_version != window.state.surface_version()
|
if window.surface_version != window.state.surface_version()
|
||||||
|
|
|
||||||
|
|
@ -1289,7 +1289,6 @@ impl SctkState {
|
||||||
match self.get_popup(settings) {
|
match self.get_popup(settings) {
|
||||||
Ok((id, parent_id, toplevel_id, surface, common)) => {
|
Ok((id, parent_id, toplevel_id, surface, common)) => {
|
||||||
let wl_surface = surface.wl_surface().clone();
|
let wl_surface = surface.wl_surface().clone();
|
||||||
receive_frame(&mut self.frame_status, &wl_surface);
|
|
||||||
send_event(&self.events_sender, &self.proxy,
|
send_event(&self.events_sender, &self.proxy,
|
||||||
SctkEvent::PopupEvent {
|
SctkEvent::PopupEvent {
|
||||||
variant: crate::platform_specific::wayland::sctk_event::PopupEventVariant::Created(self.queue_handle.clone(), surface, id, common, self.connection.display()),
|
variant: crate::platform_specific::wayland::sctk_event::PopupEventVariant::Created(self.queue_handle.clone(), surface, id, common, self.connection.display()),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
use crate::event_loop::state::receive_frame;
|
||||||
use crate::platform_specific::wayland::{
|
use crate::platform_specific::wayland::{
|
||||||
event_loop::state::{self, PopupParent, SctkState},
|
event_loop::state::{self, PopupParent, SctkState},
|
||||||
sctk_event::{PopupEventVariant, SctkEvent},
|
sctk_event::{PopupEventVariant, SctkEvent},
|
||||||
|
|
@ -28,6 +29,7 @@ impl PopupHandler for SctkState {
|
||||||
let mut guard = sctk_popup.common.lock().unwrap();
|
let mut guard = sctk_popup.common.lock().unwrap();
|
||||||
guard.size =
|
guard.size =
|
||||||
LogicalSize::new(configure.width as u32, configure.height as u32);
|
LogicalSize::new(configure.width as u32, configure.height as u32);
|
||||||
|
receive_frame(&mut self.frame_status, popup.wl_surface());
|
||||||
|
|
||||||
self.sctk_events.push(SctkEvent::PopupEvent {
|
self.sctk_events.push(SctkEvent::PopupEvent {
|
||||||
variant: PopupEventVariant::Configure(
|
variant: PopupEventVariant::Configure(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use dnd::DndSurface;
|
||||||
use iced_debug::core::theme;
|
use iced_debug::core::theme;
|
||||||
use iced_futures::{
|
use iced_futures::{
|
||||||
core::{
|
core::{
|
||||||
Clipboard as _, Clipboard as _, Size,
|
Size,
|
||||||
event::{
|
event::{
|
||||||
PlatformSpecific,
|
PlatformSpecific,
|
||||||
wayland::{
|
wayland::{
|
||||||
|
|
@ -26,7 +26,7 @@ use iced_futures::{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
event,
|
event,
|
||||||
futures::channel::mpsc,
|
futures::{SinkExt, channel::mpsc},
|
||||||
};
|
};
|
||||||
use iced_graphics::{Compositor, compositor};
|
use iced_graphics::{Compositor, compositor};
|
||||||
use iced_runtime::{
|
use iced_runtime::{
|
||||||
|
|
@ -1010,6 +1010,7 @@ impl SctkEvent {
|
||||||
false, // TODO do we want to get this value here?
|
false, // TODO do we want to get this value here?
|
||||||
theme::Mode::None, // TODO do we really need to track the system theme here?
|
theme::Mode::None, // TODO do we really need to track the system theme here?
|
||||||
);
|
);
|
||||||
|
window.state.ready = false;
|
||||||
let logical_size = window.logical_size();
|
let logical_size = window.logical_size();
|
||||||
|
|
||||||
let mut ui = crate::build_user_interface(
|
let mut ui = crate::build_user_interface(
|
||||||
|
|
@ -1083,7 +1084,6 @@ impl SctkEvent {
|
||||||
configure.width as f32,
|
configure.width as f32,
|
||||||
configure.height as f32,
|
configure.height as f32,
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some((id, w)) =
|
if let Some((id, w)) =
|
||||||
surface_ids.get(&surface.id()).and_then(|id| {
|
surface_ids.get(&surface.id()).and_then(|id| {
|
||||||
window_manager
|
window_manager
|
||||||
|
|
@ -1091,6 +1091,17 @@ impl SctkEvent {
|
||||||
.map(|v| (id.inner(), v))
|
.map(|v| (id.inner(), v))
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
w.state.ready = true;
|
||||||
|
if first {
|
||||||
|
control_sender
|
||||||
|
.send(Control::Winit(
|
||||||
|
w.raw.id(),
|
||||||
|
winit::event::WindowEvent::RedrawRequested,
|
||||||
|
)).await
|
||||||
|
.expect("Send control message");
|
||||||
|
proxy.wake_up();
|
||||||
|
}
|
||||||
|
|
||||||
let scale = w.state.scale_factor();
|
let scale = w.state.scale_factor();
|
||||||
let p_w = (configure.width.max(1) as f64 * scale)
|
let p_w = (configure.width.max(1) as f64 * scale)
|
||||||
.ceil()
|
.ceil()
|
||||||
|
|
@ -1199,12 +1210,15 @@ impl SctkEvent {
|
||||||
queue_handle,
|
queue_handle,
|
||||||
);
|
);
|
||||||
#[cfg(feature = "a11y")]
|
#[cfg(feature = "a11y")]
|
||||||
control_sender
|
{
|
||||||
.start_send(Control::InitAdapter(
|
control_sender
|
||||||
surface_id,
|
.start_send(Control::InitAdapter(
|
||||||
sctk_winit.clone(),
|
surface_id,
|
||||||
))
|
sctk_winit.clone(),
|
||||||
.expect("Send control message");
|
))
|
||||||
|
.expect("Send control message");
|
||||||
|
proxy.wake_up();
|
||||||
|
}
|
||||||
|
|
||||||
if clipboard.window_id().is_none() {
|
if clipboard.window_id().is_none() {
|
||||||
*clipboard = Clipboard::connect(
|
*clipboard = Clipboard::connect(
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ where
|
||||||
theme_mode: theme::Mode,
|
theme_mode: theme::Mode,
|
||||||
default_theme: P::Theme,
|
default_theme: P::Theme,
|
||||||
style: theme::Style,
|
style: theme::Style,
|
||||||
|
pub(crate) ready: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<P: Program> Debug for State<P>
|
impl<P: Program> Debug for State<P>
|
||||||
|
|
@ -81,6 +82,7 @@ where
|
||||||
theme_mode,
|
theme_mode,
|
||||||
default_theme,
|
default_theme,
|
||||||
style,
|
style,
|
||||||
|
ready: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue