feat(wayland): implement wp_viewporter
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@ use smithay::{
|
|||||||
egl::EGLDevice,
|
egl::EGLDevice,
|
||||||
renderer::gles::GlesRenderer,
|
renderer::gles::GlesRenderer,
|
||||||
},
|
},
|
||||||
delegate_dmabuf, delegate_output, delegate_shm,
|
delegate_dmabuf, delegate_output, delegate_shm, delegate_viewporter,
|
||||||
desktop::PopupManager,
|
desktop::PopupManager,
|
||||||
input::{SeatState, keyboard::XkbConfig},
|
input::{SeatState, keyboard::XkbConfig},
|
||||||
output::{Mode, Output, Scale, Subpixel},
|
output::{Mode, Output, Scale, Subpixel},
|
||||||
@@ -39,6 +39,7 @@ use smithay::{
|
|||||||
xdg::{WmCapabilitySet, XdgShellState},
|
xdg::{WmCapabilitySet, XdgShellState},
|
||||||
},
|
},
|
||||||
shm::{ShmHandler, ShmState},
|
shm::{ShmHandler, ShmState},
|
||||||
|
viewporter::ViewporterState,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use std::sync::{Arc, OnceLock};
|
use std::sync::{Arc, OnceLock};
|
||||||
@@ -71,6 +72,7 @@ pub struct WaylandState {
|
|||||||
pub kde_decoration_state: KdeDecorationState,
|
pub kde_decoration_state: KdeDecorationState,
|
||||||
pub shm_state: ShmState,
|
pub shm_state: ShmState,
|
||||||
dmabuf_state: (DmabufState, DmabufGlobal, Option<DmabufFeedback>),
|
dmabuf_state: (DmabufState, DmabufGlobal, Option<DmabufFeedback>),
|
||||||
|
pub viewporter_state: ViewporterState,
|
||||||
pub drm_formats: Vec<Fourcc>,
|
pub drm_formats: Vec<Fourcc>,
|
||||||
pub dmabuf_tx: UnboundedSender<(Dmabuf, Option<dmabuf::ImportNotifier>)>,
|
pub dmabuf_tx: UnboundedSender<(Dmabuf, Option<dmabuf::ImportNotifier>)>,
|
||||||
pub seat_state: SeatState<Self>,
|
pub seat_state: SeatState<Self>,
|
||||||
@@ -159,6 +161,7 @@ impl WaylandState {
|
|||||||
output.set_preferred(mode);
|
output.set_preferred(mode);
|
||||||
|
|
||||||
let mut xdg_shell = XdgShellState::new::<Self>(&display_handle);
|
let mut xdg_shell = XdgShellState::new::<Self>(&display_handle);
|
||||||
|
let viewporter_state = ViewporterState::new::<Self>(&display_handle);
|
||||||
let popup_manager = PopupManager::default();
|
let popup_manager = PopupManager::default();
|
||||||
let mut capabilities = WmCapabilitySet::default();
|
let mut capabilities = WmCapabilitySet::default();
|
||||||
capabilities.set(WmCapabilities::Maximize);
|
capabilities.set(WmCapabilities::Maximize);
|
||||||
@@ -186,6 +189,7 @@ impl WaylandState {
|
|||||||
xdg_shell,
|
xdg_shell,
|
||||||
popup_manager,
|
popup_manager,
|
||||||
output,
|
output,
|
||||||
|
viewporter_state,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -223,3 +227,4 @@ impl OutputHandler for WaylandState {
|
|||||||
delegate_dmabuf!(WaylandState);
|
delegate_dmabuf!(WaylandState);
|
||||||
delegate_shm!(WaylandState);
|
delegate_shm!(WaylandState);
|
||||||
delegate_output!(WaylandState);
|
delegate_output!(WaylandState);
|
||||||
|
delegate_viewporter!(WaylandState);
|
||||||
|
|||||||
Reference in New Issue
Block a user