From f9ce2927f2942ff791da66038b45e5b689d61871 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 10 Jul 2024 00:07:19 +0200 Subject: [PATCH] feat(sctk): more sctk features feat(sctk): support ShowWindowMenu feat(sctk): support for overflow widget sctk: Fixes for cursor icon * With multiple windows, `SetCursor` is only sent for the focused window. Fixing a flicker between icons when two windows are using different cursors. * If there is a drag surface, let that surface set the cursor. And not any other. * Set cursor on `enter`, and when switching between CSDs and app area. Fixes https://github.com/pop-os/libcosmic/issues/533. improv(sctk): per-surface cursor position tracking --- core/src/event/wayland/window.rs | 30 ++++- .../platform_specific/wayland/window.rs | 16 +-- sctk/src/application.rs | 35 ++++-- sctk/src/event_loop/mod.rs | 81 ++++++++++---- sctk/src/event_loop/state.rs | 43 ++++++-- sctk/src/handlers/seat/pointer.rs | 104 ++++++++---------- sctk/src/handlers/seat/seat.rs | 2 + sctk/src/handlers/shell/xdg_window.rs | 26 +---- sctk/src/sctk_event.rs | 56 +++++++--- 9 files changed, 233 insertions(+), 160 deletions(-) diff --git a/core/src/event/wayland/window.rs b/core/src/event/wayland/window.rs index 210b1ce1ca..bd771f4b03 100644 --- a/core/src/event/wayland/window.rs +++ b/core/src/event/wayland/window.rs @@ -1,12 +1,34 @@ #![allow(missing_docs)] -use sctk::reexports::csd_frame::{WindowManagerCapabilities, WindowState}; +use sctk::{ + reexports::csd_frame::{WindowManagerCapabilities, WindowState}, + shell::xdg::window::WindowConfigure, +}; /// window events -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone)] pub enum WindowEvent { - /// window manager capabilities + /// Window manager capabilities. WmCapabilities(WindowManagerCapabilities), - /// window state + /// Window state. State(WindowState), + /// Window configure event. + Configure(WindowConfigure), +} + +impl PartialEq for WindowEvent { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (Self::WmCapabilities(a), Self::WmCapabilities(b)) => a == b, + (Self::State(a), Self::State(b)) => a == b, + (Self::Configure(a), Self::Configure(b)) => { + a.capabilities == b.capabilities + && a.state == b.state + && a.decoration_mode == b.decoration_mode + && a.new_size == b.new_size + && a.suggested_bounds == b.suggested_bounds + } + _ => false, + } + } } diff --git a/runtime/src/command/platform_specific/wayland/window.rs b/runtime/src/command/platform_specific/wayland/window.rs index e1c94ffc48..c27085a1ac 100644 --- a/runtime/src/command/platform_specific/wayland/window.rs +++ b/runtime/src/command/platform_specific/wayland/window.rs @@ -159,10 +159,6 @@ pub enum Action { ShowWindowMenu { /// id of the window id: Id, - /// x location of popup - x: i32, - /// y location of popup - y: i32, }, /// Set the mode of the window Mode(Id, Mode), @@ -201,9 +197,7 @@ impl Action { Action::Fullscreen { id } => Action::Fullscreen { id }, Action::UnsetFullscreen { id } => Action::UnsetFullscreen { id }, Action::InteractiveMove { id } => Action::InteractiveMove { id }, - Action::ShowWindowMenu { id, x, y } => { - Action::ShowWindowMenu { id, x, y } - } + Action::ShowWindowMenu { id } => Action::ShowWindowMenu { id }, Action::InteractiveResize { id, edge } => { Action::InteractiveResize { id, edge } } @@ -274,9 +268,9 @@ impl fmt::Debug for Action { "Action::Window::InteractiveMove {{ id: {:?} }}", id ), - Action::ShowWindowMenu { id, x, y } => write!( + Action::ShowWindowMenu { id } => write!( f, - "Action::Window::ShowWindowMenu {{ id: {:?}, x: {x}, y: {y} }}", + "Action::Window::ShowWindowMenu {{ id: {:?} }}", id ), Action::InteractiveResize { id, edge } => write!( @@ -372,11 +366,13 @@ impl TryFrom> for Action { | window::Action::RequestUserAttention(_, _) | window::Action::GainFocus(_) | window::Action::ChangeLevel(_, _) - | window::Action::ShowWindowMenu(_) | window::Action::FetchId(_, _) | window::Action::ChangeIcon(_, _) | window::Action::Screenshot(_, _) | window::Action::FetchMinimized(_, _) => Err(Error::NotSupported), + window::Action::ShowWindowMenu(id) => { + Ok(Action::ShowWindowMenu { id }) + } window::Action::Maximize(id, maximized) => { if maximized { Ok(Action::Maximize { id }) diff --git a/sctk/src/application.rs b/sctk/src/application.rs index dc66c363cf..dadb47a65d 100644 --- a/sctk/src/application.rs +++ b/sctk/src/application.rs @@ -535,7 +535,12 @@ where crate::sctk_event::WindowEventVariant::WmCapabilities(_) | crate::sctk_event::WindowEventVariant::ConfigureBounds { .. } => {} crate::sctk_event::WindowEventVariant::Configure( - configure, + current_size, + _, + wl_surface, + first, + ) | crate::sctk_event::WindowEventVariant::Size( + current_size, wl_surface, first, ) => { @@ -543,6 +548,7 @@ where let Some(state) = states.get_mut(&id.inner()) else { continue; }; + let (w, h) = auto_size_surfaces.get(id).map_or_else(|| (current_size.0.get(), current_size.1.get()), |(w, h, _, _)| (*w, *h)); if state.surface.is_none() { let wrapper = SurfaceDisplayWrapper { backend: backend.clone(), @@ -553,16 +559,12 @@ where simple_clipboard = unsafe {Clipboard::connect(&h)}; } } - let mut c_surface = compositor.create_surface(wrapper.clone(), configure.new_size.0.unwrap().get(), configure.new_size.1.unwrap().get()); - compositor.configure_surface(&mut c_surface, configure.new_size.0.unwrap().get(), configure.new_size.1.unwrap().get()); + let mut c_surface = compositor.create_surface(wrapper.clone(), w, h); + compositor.configure_surface(&mut c_surface, w, h); state.surface = Some(c_surface); } - if let Some((w, h, _, is_dirty)) = auto_size_surfaces.get_mut(id) { - *is_dirty = first || *w != configure.new_size.0.map(|w| w.get()).unwrap_or_default() || *h != configure.new_size.1.map(|h| h.get()).unwrap_or_default(); - state.set_logical_size(*w as f32, *h as f32); - } else { - state.set_logical_size(configure.new_size.0.unwrap().get() as f32 , configure.new_size.1.unwrap().get() as f32); - } + state.set_logical_size(w as f32, h as f32); + if first { let user_interface = build_user_interface( &application, @@ -929,7 +931,7 @@ where // just draw here immediately and never again for dnd icons // TODO handle scale factor? - let _new_mouse_interaction = user_interface.draw( + let new_mouse_interaction = user_interface.draw( &mut renderer, state.theme(), &Style { @@ -940,6 +942,13 @@ where state.cursor(), ); + mouse_interaction = new_mouse_interaction; + ev_proxy.send_event(Event::SetCursor(mouse_interaction)); + // Pre-emptively remove cursor focus from other surface so they won't set cursor + for state in states.values_mut() { + state.cursor_position = None; + } + let subsurfaces = crate::subsurface_widget::take_subsurfaces(); if let Some(subsurface_state) = subsurface_state.as_mut() { subsurface_state.update_subsurfaces( @@ -1439,7 +1448,11 @@ where } debug.draw_finished(); - if new_mouse_interaction != mouse_interaction { + + // Set cursor if mouse interaction has changed, and surface has pointer focus + if state.cursor_position.is_some() + && new_mouse_interaction != mouse_interaction + { mouse_interaction = new_mouse_interaction; ev_proxy .send_event(Event::SetCursor(mouse_interaction)); diff --git a/sctk/src/event_loop/mod.rs b/sctk/src/event_loop/mod.rs index 27f356a593..c89689a4e5 100644 --- a/sctk/src/event_loop/mod.rs +++ b/sctk/src/event_loop/mod.rs @@ -9,7 +9,7 @@ use crate::application::SurfaceIdWrapper; use crate::{ application::Event, conversion, - dpi::LogicalSize, + dpi::{LogicalPosition, LogicalSize, PhysicalPosition}, handlers::{ activation::IcedRequestData, wp_fractional_scaling::FractionalScalingManager, @@ -47,7 +47,11 @@ use sctk::{ registry::RegistryState, seat::SeatState, session_lock::SessionLockState, - shell::{wlr_layer::LayerShell, xdg::XdgShell, WaylandSurface}, + shell::{ + wlr_layer::{LayerShell, LayerSurface}, + xdg::XdgShell, + WaylandSurface, + }, shm::Shm, }; use sctk::{ @@ -293,6 +297,8 @@ where { let mut control_flow = ControlFlow::Poll; + let mut cursor_position = HashMap::<_, LogicalPosition>::new(); + callback( IcedSctkEvent::NewEvents(StartCause::Init), &self.state, @@ -577,6 +583,18 @@ where // Handle pending sctk events. for event in sctk_event_sink_back_buffer.drain(..) { match event { + SctkEvent::PointerEvent { ref variant, .. } => { + let surface_id = variant.surface.id(); + + cursor_position.insert( + surface_id, + LogicalPosition::new( + variant.position.0, + variant.position.1, + ), + ); + } + SctkEvent::PopupEvent { variant: PopupEventVariant::Done, toplevel_id, @@ -605,13 +623,18 @@ where &mut callback, ); } - None => continue, + None => (), }; + + continue; } + SctkEvent::LayerSurfaceEvent { variant: LayerSurfaceEventVariant::Done, id, } => { + cursor_position.remove(&id.id()); + if let Some(i) = self.state.layer_surfaces.iter().position(|l| { l.surface.wl_surface().id() == id.id() @@ -630,7 +653,10 @@ where &mut callback, ); } + + continue; } + SctkEvent::WindowEvent { variant: WindowEventVariant::Close, id, @@ -654,14 +680,18 @@ where &mut callback, ); } + + continue; } - _ => sticky_exit_callback( - IcedSctkEvent::SctkEvent(event), - &self.state, - &mut control_flow, - &mut callback, - ), + _ => (), } + + sticky_exit_callback( + IcedSctkEvent::SctkEvent(event), + &self.state, + &mut control_flow, + &mut callback, + ) } // handle events indirectly via callback to the user. @@ -808,9 +838,10 @@ where }, }, Event::SetCursor(iced_icon) => { - if let Some(ptr) = self.state.seats.get(0).and_then(|s| s.ptr.as_ref()) { + if let Some(seat) = self.state.seats.get_mut(0) { let icon = conversion::cursor_icon(iced_icon); - let _ = ptr.set_cursor(self.wayland_dispatcher.as_source_ref().connection(), icon); + seat.icon = Some(icon); + seat.set_cursor(self.wayland_dispatcher.as_source_ref().connection(), icon); } } @@ -845,18 +876,12 @@ where }, platform_specific::wayland::window::Action::Size { id, width, height } => { if let Some(window) = self.state.windows.iter_mut().find(|w| w.id == id) { - window.set_size(LogicalSize::new(NonZeroU32::new(width).unwrap_or(NonZeroU32::new(1).unwrap()), NonZeroU32::new(1).unwrap())); + window.set_size(LogicalSize::new(NonZeroU32::new(width).unwrap_or(NonZeroU32::new(1).unwrap()), NonZeroU32::new(height).unwrap_or(NonZeroU32::new(1).unwrap()))); // TODO Ashley maybe don't force window size? pending_redraws.push(window.window.wl_surface().id()); - - if let Some(mut prev_configure) = window.last_configure.clone() { - let (width, height) = ( - NonZeroU32::new(width).unwrap_or(NonZeroU32::new(1).unwrap()), - NonZeroU32::new(height).unwrap_or(NonZeroU32::new(1).unwrap()), - ); - prev_configure.new_size = (Some(width), Some(height)); + if window.last_configure.is_some() { sticky_exit_callback( - IcedSctkEvent::SctkEvent(SctkEvent::WindowEvent { variant: WindowEventVariant::Configure(prev_configure, window.window.wl_surface().clone(), false), id: window.window.wl_surface().clone()}), + IcedSctkEvent::SctkEvent(SctkEvent::WindowEvent { variant: WindowEventVariant::Size(window.current_size, window.window.wl_surface().clone(), false), id: window.window.wl_surface().clone()}), &self.state, &mut control_flow, &mut callback, @@ -937,7 +962,21 @@ where } } }, - platform_specific::wayland::window::Action::ShowWindowMenu { id: _, x: _, y: _ } => todo!(), + platform_specific::wayland::window::Action::ShowWindowMenu { id } => { + if let (Some(window), Some((seat, last_press))) = (self.state.windows.iter_mut().find(|w| w.id == id), self.state.seats.first().and_then(|seat| seat.last_ptr_press.map(|p| (&seat.seat, p.2)))) { + let surface_id = window.window.wl_surface().id(); + + let cursor_position = cursor_position.get(&surface_id) + .cloned() + .unwrap_or_default(); + + // Cursor position does not need to be scaled here. + let PhysicalPosition { x, y } = cursor_position.to_physical::(1.0); + + window.window.xdg_toplevel().show_window_menu(seat, last_press, x as i32, y as i32); + to_commit.insert(id, window.window.wl_surface().clone()); + } + }, platform_specific::wayland::window::Action::Destroy(id) => { if let Some(i) = self.state.windows.iter().position(|l| l.id == id) { let window = self.state.windows.remove(i); diff --git a/sctk/src/event_loop/state.rs b/sctk/src/event_loop/state.rs index 0782ab3ae8..5623f7e0b8 100644 --- a/sctk/src/event_loop/state.rs +++ b/sctk/src/event_loop/state.rs @@ -98,16 +98,28 @@ pub(crate) struct SctkSeat { pub(crate) last_touch_down: Option<(u32, i32, u32)>, // (time, point, serial) pub(crate) _modifiers: Modifiers, pub(crate) data_device: DataDevice, + // Cursor icon currently set (by CSDs, or application) + pub(crate) active_icon: Option, + // Cursor icon set by application pub(crate) icon: Option, } +impl SctkSeat { + pub(crate) fn set_cursor(&mut self, conn: &Connection, icon: CursorIcon) { + if let Some(ptr) = self.ptr.as_ref() { + ptr.set_cursor(conn, icon); + self.active_icon = Some(icon); + } + } +} + #[derive(Debug, Clone)] pub struct SctkWindow { pub(crate) id: window::Id, pub(crate) window: Window, pub(crate) scale_factor: Option, - pub(crate) requested_size: Option<(u32, u32)>, - pub(crate) current_size: Option<(NonZeroU32, NonZeroU32)>, + pub(crate) requested_size: Option<(NonZeroU32, NonZeroU32)>, + pub(crate) current_size: (NonZeroU32, NonZeroU32), pub(crate) last_configure: Option, pub(crate) resizable: Option, /// Requests that SCTK window should perform. @@ -119,18 +131,24 @@ pub struct SctkWindow { impl SctkWindow { pub(crate) fn set_size(&mut self, logical_size: LogicalSize) { - self.requested_size = - Some((logical_size.width.get(), logical_size.height.get())); - self.update_size(logical_size) + self.requested_size = Some((logical_size.width, logical_size.height)); + self.update_size((Some(logical_size.width), Some(logical_size.height))) } pub(crate) fn update_size( &mut self, - LogicalSize { width, height }: LogicalSize, + (width, height): (Option, Option), ) { + let (width, height) = ( + width.unwrap_or_else(|| self.current_size.0), + height.unwrap_or_else(|| self.current_size.1), + ); + if self.current_size == (width, height) { + return; + } self.window .set_window_geometry(0, 0, width.get(), height.get()); - self.current_size = Some((width, height)); + self.current_size = (width, height); // Update the target viewport, this is used if and only if fractional scaling is in use. if let Some(viewport) = self.wp_viewport.as_ref() { // Set inner size without the borders. @@ -721,15 +739,16 @@ where fsm.fractional_scaling(window.wl_surface(), &self.queue_handle) }); + let w = NonZeroU32::new(size.0 as u32) + .unwrap_or_else(|| NonZeroU32::new(1).unwrap()); + let h = NonZeroU32::new(size.1 as u32) + .unwrap_or_else(|| NonZeroU32::new(1).unwrap()); self.windows.push(SctkWindow { id: window_id, window, scale_factor: None, - requested_size: Some(size), - current_size: Some(( - NonZeroU32::new(1).unwrap(), - NonZeroU32::new(1).unwrap(), - )), + requested_size: Some((w, h)), + current_size: (w, h), last_configure: None, _pending_requests: Vec::new(), resizable, diff --git a/sctk/src/handlers/seat/pointer.rs b/sctk/src/handlers/seat/pointer.rs index 9777a320e4..eec170964e 100644 --- a/sctk/src/handlers/seat/pointer.rs +++ b/sctk/src/handlers/seat/pointer.rs @@ -35,37 +35,36 @@ impl PointerHandler for SctkState { .iter() .find(|w| w.window.wl_surface() == &e.surface) .and_then(|w| { - w.resizable.zip(w.current_size).and_then( - |(border, (width, height))| { - let (width, height) = - (width.get() as f64, height.get() as f64); - let (x, y) = e.position; - let left_edge = x < border; - let top_edge = y < border; - let right_edge = x > width - border; - let bottom_edge = y > height - border; + w.resizable.and_then(|border| { + let (width, height) = w.current_size; + let (width, height) = + (width.get() as f64, height.get() as f64); + let (x, y) = e.position; + let left_edge = x < border; + let top_edge = y < border; + let right_edge = x > width - border; + let bottom_edge = y > height - border; - if left_edge && top_edge { - Some((ResizeEdge::TopLeft, w)) - } else if left_edge && bottom_edge { - Some((ResizeEdge::BottomLeft, w)) - } else if right_edge && top_edge { - Some((ResizeEdge::TopRight, w)) - } else if right_edge && bottom_edge { - Some((ResizeEdge::BottomRight, w)) - } else if left_edge { - Some((ResizeEdge::Left, w)) - } else if right_edge { - Some((ResizeEdge::Right, w)) - } else if top_edge { - Some((ResizeEdge::Top, w)) - } else if bottom_edge { - Some((ResizeEdge::Bottom, w)) - } else { - None - } - }, - ) + if left_edge && top_edge { + Some((ResizeEdge::TopLeft, w)) + } else if left_edge && bottom_edge { + Some((ResizeEdge::BottomLeft, w)) + } else if right_edge && top_edge { + Some((ResizeEdge::TopRight, w)) + } else if right_edge && bottom_edge { + Some((ResizeEdge::BottomRight, w)) + } else if left_edge { + Some((ResizeEdge::Left, w)) + } else if right_edge { + Some((ResizeEdge::Right, w)) + } else if top_edge { + Some((ResizeEdge::Top, w)) + } else if bottom_edge { + Some((ResizeEdge::Bottom, w)) + } else { + None + } + }) }) { let icon = match resize_edge { @@ -94,41 +93,24 @@ impl PointerHandler for SctkState { return; } PointerEventKind::Motion { .. } => { - if my_seat.icon != Some(icon) { - let _ = my_seat - .ptr - .as_ref() - .unwrap() - .set_cursor(conn, icon); - my_seat.icon = Some(icon); + if my_seat.active_icon != Some(icon) { + let _ = my_seat.set_cursor(conn, icon); } return; } - PointerEventKind::Enter { .. } => { - my_seat.ptr_focus.replace(e.surface.clone()); - if my_seat.icon != Some(icon) { - let _ = my_seat - .ptr - .as_ref() - .unwrap() - .set_cursor(conn, icon); - my_seat.icon = Some(icon); - } - } - PointerEventKind::Leave { .. } => { - my_seat.ptr_focus.take(); - my_seat.icon = None; - } + PointerEventKind::Enter { .. } => {} + PointerEventKind::Leave { .. } => {} _ => {} } - let _ = my_seat.ptr.as_ref().unwrap().set_cursor(conn, icon); - } else if my_seat.icon.is_some() { - let _ = my_seat - .ptr - .as_ref() - .unwrap() - .set_cursor(conn, CursorIcon::Default); - my_seat.icon = None; + if my_seat.active_icon != Some(icon) { + my_seat.set_cursor(conn, icon); + } + } else if my_seat.active_icon != my_seat.icon { + // Restore cursor that was set by appliction, or default + my_seat.set_cursor( + conn, + my_seat.icon.unwrap_or(CursorIcon::Default), + ); } if is_active { @@ -144,7 +126,7 @@ impl PointerHandler for SctkState { } PointerEventKind::Leave { .. } => { my_seat.ptr_focus.take(); - my_seat.icon = None; + my_seat.active_icon = None; } PointerEventKind::Press { time, diff --git a/sctk/src/handlers/seat/seat.rs b/sctk/src/handlers/seat/seat.rs index adc5e0e842..ce90b7d86f 100644 --- a/sctk/src/handlers/seat/seat.rs +++ b/sctk/src/handlers/seat/seat.rs @@ -43,6 +43,7 @@ where last_kbd_press: None, last_touch_down: None, icon: None, + active_icon: None, }); } @@ -71,6 +72,7 @@ where last_kbd_press: None, last_touch_down: None, icon: None, + active_icon: None, }); self.seats.last_mut().unwrap() } diff --git a/sctk/src/handlers/shell/xdg_window.rs b/sctk/src/handlers/shell/xdg_window.rs index 6b4505737b..6dd9da14f4 100644 --- a/sctk/src/handlers/shell/xdg_window.rs +++ b/sctk/src/handlers/shell/xdg_window.rs @@ -37,7 +37,7 @@ impl WindowHandler for SctkState { _conn: &sctk::reexports::client::Connection, _qh: &sctk::reexports::client::QueueHandle, window: &sctk::shell::xdg::window::Window, - mut configure: sctk::shell::xdg::window::WindowConfigure, + configure: sctk::shell::xdg::window::WindowConfigure, _serial: u32, ) { let window = match self @@ -68,28 +68,7 @@ impl WindowHandler for SctkState { }); } - if configure.new_size.0.is_none() { - configure.new_size.0 = Some( - window - .requested_size - .and_then(|r| NonZeroU32::new(r.0)) - .unwrap_or_else(|| NonZeroU32::new(300).unwrap()), - ); - } - if configure.new_size.1.is_none() { - configure.new_size.1 = Some( - window - .requested_size - .and_then(|r| NonZeroU32::new(r.1)) - .unwrap_or_else(|| NonZeroU32::new(500).unwrap()), - ); - } - if let Some(new_size) = configure.new_size.0.zip(configure.new_size.1) { - window.update_size(LogicalSize { - width: new_size.0, - height: new_size.1, - }); - } + window.update_size(configure.new_size); let wl_surface = window.window.wl_surface(); let id = wl_surface.clone(); @@ -98,6 +77,7 @@ impl WindowHandler for SctkState { self.sctk_events.push(SctkEvent::WindowEvent { variant: WindowEventVariant::Configure( + window.current_size, configure, wl_surface.clone(), first, diff --git a/sctk/src/sctk_event.rs b/sctk/src/sctk_event.rs index c7a1f211c6..5c9ac61b39 100755 --- a/sctk/src/sctk_event.rs +++ b/sctk/src/sctk_event.rs @@ -41,7 +41,7 @@ use sctk::{ xdg::{popup::PopupConfigure, window::WindowConfigure}, }, }; -use std::{collections::HashMap, time::Instant}; +use std::{collections::HashMap, num::NonZeroU32, time::Instant}; use wayland_protocols::wp::viewporter::client::wp_viewport::WpViewport; use xkeysym::Keysym; @@ -310,8 +310,8 @@ pub enum WindowEventVariant { height: u32, }, /// - Configure(WindowConfigure, WlSurface, bool), - + Configure((NonZeroU32, NonZeroU32), WindowConfigure, WlSurface, bool), + Size((NonZeroU32, NonZeroU32), WlSurface, bool), /// window state changed StateChanged(sctk::reexports::csd_frame::WindowState), /// Scale Factor @@ -674,27 +674,46 @@ impl SctkEvent { WindowEventVariant::ConfigureBounds { .. } => { Default::default() } - WindowEventVariant::Configure(configure, surface, _) => { - if let (Some(new_width), Some(new_height)) = - configure.new_size - { - surface_ids - .get(&surface.id()) - .map(|id| { + WindowEventVariant::Configure( + (new_width, new_height), + configure, + surface, + _, + ) => surface_ids + .get(&surface.id()) + .map(|id| { + if configure.is_resizing() { + vec![iced_runtime::core::Event::Window( + id.inner(), + window::Event::Resized { + width: new_width.get(), + height: new_height.get(), + }, + )] + } else { + vec![ iced_runtime::core::Event::Window( id.inner(), window::Event::Resized { width: new_width.get(), height: new_height.get(), }, - ) - }) - .into_iter() - .collect() - } else { - Default::default() - } - } + ), + iced_runtime::core::Event::PlatformSpecific( + PlatformSpecific::Wayland( + wayland::Event::Window( + wayland::WindowEvent::Configure( + configure, + ), + surface, + id.inner(), + ), + ), + ), + ] + } + }) + .unwrap_or_default(), WindowEventVariant::ScaleFactorChanged(..) => { Default::default() } @@ -711,6 +730,7 @@ impl SctkEvent { }) .into_iter() .collect(), + WindowEventVariant::Size(_, _, _) => vec![], }, SctkEvent::LayerSurfaceEvent { variant,