srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/src/winit
diff options
context:
space:
mode:
Diffstat (limited to 'crates/wayland/src/winit')
-rw-r--r--crates/wayland/src/winit/connect.rs14
-rw-r--r--crates/wayland/src/winit/nested_platform.rs10
2 files changed, 24 insertions, 0 deletions
diff --git a/crates/wayland/src/winit/connect.rs b/crates/wayland/src/winit/connect.rs
index 140dc58..39eda5a 100644
--- a/crates/wayland/src/winit/connect.rs
+++ b/crates/wayland/src/winit/connect.rs
@@ -111,6 +111,7 @@ impl WaylandPlatform {
data_control_state,
session_lock_state: SessionLockManagerState::new::<CompState, _>(&dh, |_| true),
_screencopy_state: screencopy::ScreencopyState::new::<CompState>(&dh),
+ _virtual_pointer_state: crate::virtual_pointer::VirtualPointerState::new::<CompState>(&dh),
screencopy_pending: Vec::new(),
_appmenu_state: crate::appmenu::AppmenuManagerState::new::<CompState>(&dh),
_virtual_keyboard_state: smithay::wayland::virtual_keyboard::VirtualKeyboardManagerState::new::<CompState, _>(&dh, |_client| true),
@@ -154,6 +155,8 @@ impl WaylandPlatform {
desktop_icons: None,
desktop_icon_buffers: HashMap::new(),
desktop_icon_drag: None,
+ desktop_marquee: None,
+ marquee_buffers: Default::default(),
desktop_menu: None,
desktop_menu_buffer: None,
last_icon_click: None,
@@ -161,6 +164,7 @@ impl WaylandPlatform {
wm: wm.clone(),
surface_to_id: HashMap::new(),
id_to_window: HashMap::new(),
+ virtual_pointers: Vec::new(),
dead_layer_surfaces: HashSet::new(),
hidden_layer_surfaces: HashMap::new(),
layer_surfaces_shown_once: HashSet::new(),
@@ -192,6 +196,16 @@ impl WaylandPlatform {
appmenu_registrar: None,
};
+ // Same per-app remembered position/size seeding as the udev
+ // backend's own `connect()` - see that call site's own comment
+ // and `window_memory.rs` for what/why. The nested backend has no
+ // daily-driver use case of its own, but a window mapped while
+ // testing under it should still honor whatever a real session
+ // already remembered, not silently ignore the same store.
+ for (app_id, g) in crate::window_memory::load() {
+ wm.borrow_mut().set_remembered_geometry(app_id, (g.x, g.y, g.width, g.height));
+ }
+
let listener = ListeningSocket::bind_auto("wayland", 0..32).map_err(err)?;
if let Some(name) = listener.socket_name() {
std::env::set_var("WAYLAND_DISPLAY", name);
diff --git a/crates/wayland/src/winit/nested_platform.rs b/crates/wayland/src/winit/nested_platform.rs
index 316b1b5..40d03ff 100644
--- a/crates/wayland/src/winit/nested_platform.rs
+++ b/crates/wayland/src/winit/nested_platform.rs
@@ -69,6 +69,16 @@ impl Platform for WaylandPlatform {
self.state.begin_native_lock();
}
self.state.poll_native_lock_auth();
+ // Same pin-input draining as `udev/platform.rs`'s matching block --
+ // see its own comment and `virtual_pointer.rs`'s module doc
+ // comment for the full Phase 2 design. Pinned virtual-pointer
+ // delivery never touches `udev`/`bounds()` at all (unlike this
+ // backend's own unpinned motion, which is a documented no-op
+ // here), so this is exercised here too - genuinely the way to
+ // validate it in a nested instance rather than the live session.
+ for (pid, window) in self.wm.borrow_mut().drain_pin_input_requests() {
+ self.state.set_virtual_pointer_pin(pid, window);
+ }
let wait = TARGET_FRAME_TIME.saturating_sub(self.last_frame.elapsed());
let _ = self.idle_event_loop.dispatch(Some(wait), &mut self.state);
self.last_frame = Instant::now();