From b54eb60f800dce540e49f1872f3fe68459908a2c Mon Sep 17 00:00:00 2001 From: Schmarni Date: Thu, 17 Apr 2025 00:40:17 +0200 Subject: [PATCH] feat(wayland): implement wp_viewporter Signed-off-by: Schmarni --- src/wayland/state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wayland/state.rs b/src/wayland/state.rs index 711e32c..f43c4ce 100644 --- a/src/wayland/state.rs +++ b/src/wayland/state.rs @@ -7,7 +7,7 @@ use smithay::{ egl::EGLDevice, renderer::gles::GlesRenderer, }, - delegate_dmabuf, delegate_output, delegate_shm, + delegate_dmabuf, delegate_output, delegate_shm, delegate_viewporter, desktop::PopupManager, input::{SeatState, keyboard::XkbConfig}, output::{Mode, Output, Scale, Subpixel}, @@ -39,6 +39,7 @@ use smithay::{ xdg::{WmCapabilitySet, XdgShellState}, }, shm::{ShmHandler, ShmState}, + viewporter::ViewporterState, }, }; use std::sync::{Arc, OnceLock}; @@ -71,6 +72,7 @@ pub struct WaylandState { pub kde_decoration_state: KdeDecorationState, pub shm_state: ShmState, dmabuf_state: (DmabufState, DmabufGlobal, Option), + pub viewporter_state: ViewporterState, pub drm_formats: Vec, pub dmabuf_tx: UnboundedSender<(Dmabuf, Option)>, pub seat_state: SeatState, @@ -159,6 +161,7 @@ impl WaylandState { output.set_preferred(mode); let mut xdg_shell = XdgShellState::new::(&display_handle); + let viewporter_state = ViewporterState::new::(&display_handle); let popup_manager = PopupManager::default(); let mut capabilities = WmCapabilitySet::default(); capabilities.set(WmCapabilities::Maximize); @@ -186,6 +189,7 @@ impl WaylandState { xdg_shell, popup_manager, output, + viewporter_state, }) }) } @@ -223,3 +227,4 @@ impl OutputHandler for WaylandState { delegate_dmabuf!(WaylandState); delegate_shm!(WaylandState); delegate_output!(WaylandState); +delegate_viewporter!(WaylandState); -- 2.49.1