Add wp-viewporter

Doesn't hurt I guess.
This commit is contained in:
Ivan Molodetskikh
2024-03-08 16:52:54 +04:00
parent ca22e70cc4
commit 348690afb6
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -51,7 +51,7 @@ use smithay::{
delegate_output, delegate_pointer_constraints, delegate_pointer_gestures, delegate_output, delegate_pointer_constraints, delegate_pointer_gestures,
delegate_presentation, delegate_primary_selection, delegate_relative_pointer, delegate_seat, delegate_presentation, delegate_primary_selection, delegate_relative_pointer, delegate_seat,
delegate_security_context, delegate_session_lock, delegate_tablet_manager, delegate_security_context, delegate_session_lock, delegate_tablet_manager,
delegate_text_input_manager, delegate_virtual_keyboard_manager, delegate_text_input_manager, delegate_viewporter, delegate_virtual_keyboard_manager,
}; };
use crate::niri::{ClientState, State}; use crate::niri::{ClientState, State};
@@ -438,3 +438,5 @@ impl DrmLeaseHandler for State {
} }
} }
delegate_drm_lease!(State); delegate_drm_lease!(State);
delegate_viewporter!(State);
+4
View File
@@ -84,6 +84,7 @@ use smithay::wayland::shm::ShmState;
use smithay::wayland::socket::ListeningSocketSource; use smithay::wayland::socket::ListeningSocketSource;
use smithay::wayland::tablet_manager::{TabletManagerState, TabletSeatTrait}; use smithay::wayland::tablet_manager::{TabletManagerState, TabletSeatTrait};
use smithay::wayland::text_input::TextInputManagerState; use smithay::wayland::text_input::TextInputManagerState;
use smithay::wayland::viewporter::ViewporterState;
use smithay::wayland::virtual_keyboard::VirtualKeyboardManagerState; use smithay::wayland::virtual_keyboard::VirtualKeyboardManagerState;
use crate::backend::tty::SurfaceDmabufFeedback; use crate::backend::tty::SurfaceDmabufFeedback;
@@ -158,6 +159,7 @@ pub struct Niri {
pub session_lock_state: SessionLockManagerState, pub session_lock_state: SessionLockManagerState,
pub foreign_toplevel_state: ForeignToplevelManagerState, pub foreign_toplevel_state: ForeignToplevelManagerState,
pub screencopy_state: ScreencopyManagerState, pub screencopy_state: ScreencopyManagerState,
pub viewporter_state: ViewporterState,
pub shm_state: ShmState, pub shm_state: ShmState,
pub output_manager_state: OutputManagerState, pub output_manager_state: OutputManagerState,
pub dmabuf_state: DmabufState, pub dmabuf_state: DmabufState,
@@ -917,6 +919,7 @@ impl Niri {
let screencopy_state = ScreencopyManagerState::new::<State, _>(&display_handle, |client| { let screencopy_state = ScreencopyManagerState::new::<State, _>(&display_handle, |client| {
!client.get_data::<ClientState>().unwrap().restricted !client.get_data::<ClientState>().unwrap().restricted
}); });
let viewporter_state = ViewporterState::new::<State>(&display_handle);
let mut seat: Seat<State> = seat_state.new_wl_seat(&display_handle, backend.seat_name()); let mut seat: Seat<State> = seat_state.new_wl_seat(&display_handle, backend.seat_name());
seat.add_keyboard( seat.add_keyboard(
@@ -1038,6 +1041,7 @@ impl Niri {
session_lock_state, session_lock_state,
foreign_toplevel_state, foreign_toplevel_state,
screencopy_state, screencopy_state,
viewporter_state,
text_input_state, text_input_state,
input_method_state, input_method_state,
virtual_keyboard_state, virtual_keyboard_state,