Add wp-viewporter
Browse files at this commit348690afb637514a38ad53fd61bf5e0102e419d6Parent: ca22e702 changed files +7 -1
- src/handlers/mod.rs +3 -1
- src/niri.rs +4 -0
src/handlers/mod.rsmodified+3 -1
| @@ -51,7 +51,7 @@ use smithay::{ | |||
| 51 | delegate_output, delegate_pointer_constraints, delegate_pointer_gestures, | 51 | delegate_output, delegate_pointer_constraints, delegate_pointer_gestures, |
| 52 | delegate_presentation, delegate_primary_selection, delegate_relative_pointer, delegate_seat, | 52 | delegate_presentation, delegate_primary_selection, delegate_relative_pointer, delegate_seat, |
| 53 | delegate_security_context, delegate_session_lock, delegate_tablet_manager, | 53 | delegate_security_context, delegate_session_lock, delegate_tablet_manager, |
| 54 | - delegate_text_input_manager, delegate_virtual_keyboard_manager, | 54 | + delegate_text_input_manager, delegate_viewporter, delegate_virtual_keyboard_manager, |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | use crate::niri::{ClientState, State}; | 57 | use crate::niri::{ClientState, State}; |
| @@ -438,3 +438,5 @@ impl DrmLeaseHandler for State { | |||
| 438 | } | 438 | } |
| 439 | } | 439 | } |
| 440 | delegate_drm_lease!(State); | 440 | delegate_drm_lease!(State); |
| 441 | + | ||
| 442 | +delegate_viewporter!(State); | ||
src/niri.rsmodified+4 -0
| @@ -84,6 +84,7 @@ use smithay::wayland::shm::ShmState; | |||
| 84 | use smithay::wayland::socket::ListeningSocketSource; | 84 | use smithay::wayland::socket::ListeningSocketSource; |
| 85 | use smithay::wayland::tablet_manager::{TabletManagerState, TabletSeatTrait}; | 85 | use smithay::wayland::tablet_manager::{TabletManagerState, TabletSeatTrait}; |
| 86 | use smithay::wayland::text_input::TextInputManagerState; | 86 | use smithay::wayland::text_input::TextInputManagerState; |
| 87 | +use smithay::wayland::viewporter::ViewporterState; | ||
| 87 | use smithay::wayland::virtual_keyboard::VirtualKeyboardManagerState; | 88 | use smithay::wayland::virtual_keyboard::VirtualKeyboardManagerState; |
| 88 | 89 | ||
| 89 | use crate::backend::tty::SurfaceDmabufFeedback; | 90 | use crate::backend::tty::SurfaceDmabufFeedback; |
| @@ -158,6 +159,7 @@ pub struct Niri { | |||
| 158 | pub session_lock_state: SessionLockManagerState, | 159 | pub session_lock_state: SessionLockManagerState, |
| 159 | pub foreign_toplevel_state: ForeignToplevelManagerState, | 160 | pub foreign_toplevel_state: ForeignToplevelManagerState, |
| 160 | pub screencopy_state: ScreencopyManagerState, | 161 | pub screencopy_state: ScreencopyManagerState, |
| 162 | + pub viewporter_state: ViewporterState, | ||
| 161 | pub shm_state: ShmState, | 163 | pub shm_state: ShmState, |
| 162 | pub output_manager_state: OutputManagerState, | 164 | pub output_manager_state: OutputManagerState, |
| 163 | pub dmabuf_state: DmabufState, | 165 | pub dmabuf_state: DmabufState, |
| @@ -917,6 +919,7 @@ impl Niri { | |||
| 917 | let screencopy_state = ScreencopyManagerState::new::<State, _>(&display_handle, |client| { | 919 | let screencopy_state = ScreencopyManagerState::new::<State, _>(&display_handle, |client| { |
| 918 | !client.get_data::<ClientState>().unwrap().restricted | 920 | !client.get_data::<ClientState>().unwrap().restricted |
| 919 | }); | 921 | }); |
| 922 | + let viewporter_state = ViewporterState::new::<State>(&display_handle); | ||
| 920 | 923 | ||
| 921 | let mut seat: Seat<State> = seat_state.new_wl_seat(&display_handle, backend.seat_name()); | 924 | let mut seat: Seat<State> = seat_state.new_wl_seat(&display_handle, backend.seat_name()); |
| 922 | seat.add_keyboard( | 925 | seat.add_keyboard( |
| @@ -1038,6 +1041,7 @@ impl Niri { | |||
| 1038 | session_lock_state, | 1041 | session_lock_state, |
| 1039 | foreign_toplevel_state, | 1042 | foreign_toplevel_state, |
| 1040 | screencopy_state, | 1043 | screencopy_state, |
| 1044 | + viewporter_state, | ||
| 1041 | text_input_state, | 1045 | text_input_state, |
| 1042 | input_method_state, | 1046 | input_method_state, |
| 1043 | virtual_keyboard_state, | 1047 | virtual_keyboard_state, |