diff --git a/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs b/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs index 2a37d7f8e6..bba631f9f5 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs @@ -56,10 +56,10 @@ impl KeyboardHandler for SctkState { winit::event::WindowEvent::Focused(true), )); self.sctk_events.push(SctkEvent::KeyboardEvent { - variant: KeyboardEventVariant::Enter(surface.clone()), - kbd_id: keyboard.clone(), - seat_id: seat, - surface: surface.clone(), + variant: KeyboardEventVariant::Enter(surface.clone()), + kbd_id: keyboard.clone(), + seat_id: seat, + surface: surface.clone(), }); } } diff --git a/winit/src/platform_specific/wayland/mod.rs b/winit/src/platform_specific/wayland/mod.rs index da080f7b04..8a65f41204 100644 --- a/winit/src/platform_specific/wayland/mod.rs +++ b/winit/src/platform_specific/wayland/mod.rs @@ -63,7 +63,6 @@ pub(crate) struct WaylandSpecific { modifiers: Modifiers, surface_ids: HashMap, destroyed_surface_ids: HashMap, - subsurface_ids: HashMap, subsurface_state: Option, surface_subsurfaces: HashMap>, } @@ -138,7 +137,6 @@ impl WaylandSpecific { display_handle, surface_ids, destroyed_surface_ids, - subsurface_ids, modifiers, subsurface_state, surface_subsurfaces, @@ -165,7 +163,6 @@ impl WaylandSpecific { compositor, window_manager, surface_ids, - subsurface_ids, sender, event_sender, proxy, @@ -198,8 +195,6 @@ impl WaylandSpecific { }; subsurface_state.update_subsurfaces( - id, - &mut self.subsurface_ids, wl_surface, surface_subsurfaces, &subsurfaces, diff --git a/winit/src/platform_specific/wayland/sctk_event.rs b/winit/src/platform_specific/wayland/sctk_event.rs index 3f35c3890d..c15c3caa2e 100755 --- a/winit/src/platform_specific/wayland/sctk_event.rs +++ b/winit/src/platform_specific/wayland/sctk_event.rs @@ -290,7 +290,6 @@ impl SctkEvent { compositor: &mut C, window_manager: &mut crate::program::WindowManager, surface_ids: &mut HashMap, - subsurface_ids: &mut HashMap, sctk_tx: &channel::Sender, control_sender: &mpsc::UnboundedSender, proxy: &EventLoopProxy, @@ -326,13 +325,6 @@ impl SctkEvent { iced_runtime::core::Event::Mouse(mouse::Event::CursorLeft), )), PointerEventKind::Motion { .. } => { - let offset = if let Some((x_offset, y_offset, _)) = - subsurface_ids.get(&variant.surface.id()) - { - (*x_offset, *y_offset) - } else { - (0, 0) - }; let id = surface_ids .get(&variant.surface.id()) .map(|id| id.inner()); @@ -340,11 +332,7 @@ impl SctkEvent { id.clone().and_then(|id| window_manager.get_mut(id)) { w.state.set_logical_cursor_pos( - ( - variant.position.0 + offset.0 as f64, - variant.position.1 + offset.1 as f64, - ) - .into(), + (variant.position.0, variant.position.1).into(), ) } events.push(( @@ -352,8 +340,8 @@ impl SctkEvent { iced_runtime::core::Event::Mouse( mouse::Event::CursorMoved { position: Point::new( - variant.position.0 as f32 + offset.0 as f32, - variant.position.1 as f32 + offset.1 as f32, + variant.position.0 as f32, + variant.position.1 as f32, ), }, ), diff --git a/winit/src/platform_specific/wayland/subsurface_widget.rs b/winit/src/platform_specific/wayland/subsurface_widget.rs index 7922ae616c..40c702e811 100644 --- a/winit/src/platform_specific/wayland/subsurface_widget.rs +++ b/winit/src/platform_specific/wayland/subsurface_widget.rs @@ -368,8 +368,6 @@ impl SubsurfaceState { // Update `subsurfaces` from `view_subsurfaces` pub(crate) fn update_subsurfaces( &mut self, - parent_id: window::Id, - subsurface_ids: &mut HashMap, parent: &WlSurface, subsurfaces: &mut Vec, view_subsurfaces: &[SubsurfaceInfo], @@ -405,16 +403,7 @@ impl SubsurfaceState { for (subsurface_data, subsurface) in view_subsurfaces.iter().zip(subsurfaces.iter_mut()) { - subsurface.attach_and_commit( - parent_id, - subsurface_ids, - subsurface_data, - self, - ); - } - - if let Some(backend) = parent.backend().upgrade() { - subsurface_ids.retain(|k, _| backend.info(k.clone()).is_ok()); + subsurface.attach_and_commit(subsurface_data, self); } } @@ -478,8 +467,6 @@ impl SubsurfaceInstance { // TODO correct damage? no damage/commit if unchanged? fn attach_and_commit( &mut self, - parent_id: window::Id, - subsurface_ids: &mut HashMap, info: &SubsurfaceInfo, state: &mut SubsurfaceState, ) { @@ -542,11 +529,6 @@ impl SubsurfaceInstance { wp_alpha_modifier_surface.set_multiplier(alpha); } - _ = subsurface_ids.insert( - self.wl_surface.id(), - (info.bounds.x as i32, info.bounds.y as i32, parent_id), - ); - self.wl_buffer = Some(buffer); self.bounds = Some(info.bounds); }