Skip to content

Commit

Permalink
Implement relative-pointer
Browse files Browse the repository at this point in the history
Xwayland actually makes use of it, so I can finally verify that it
works!
  • Loading branch information
YaLTeR committed Dec 4, 2023
1 parent 0e29e7f commit 40b633b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ use smithay::wayland::session_lock::{
use smithay::{
delegate_cursor_shape, delegate_data_control, delegate_data_device, delegate_dmabuf,
delegate_input_method_manager, delegate_output, delegate_pointer_gestures,
delegate_presentation, delegate_primary_selection, delegate_seat, delegate_session_lock,
delegate_tablet_manager, delegate_text_input_manager, delegate_virtual_keyboard_manager,
delegate_presentation, delegate_primary_selection, delegate_relative_pointer, delegate_seat,
delegate_session_lock, delegate_tablet_manager, delegate_text_input_manager,
delegate_virtual_keyboard_manager,
};

use crate::layout::output_size;
Expand Down Expand Up @@ -74,6 +75,7 @@ delegate_seat!(State);
delegate_cursor_shape!(State);
delegate_tablet_manager!(State);
delegate_pointer_gestures!(State);
delegate_relative_pointer!(State);
delegate_text_input_manager!(State);

impl InputMethodHandler for State {
Expand Down
4 changes: 4 additions & 0 deletions src/niri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ use smithay::wayland::input_method::InputMethodManagerState;
use smithay::wayland::output::OutputManagerState;
use smithay::wayland::pointer_gestures::PointerGesturesState;
use smithay::wayland::presentation::PresentationState;
use smithay::wayland::relative_pointer::RelativePointerManagerState;
use smithay::wayland::selection::data_device::{set_data_device_selection, DataDeviceState};
use smithay::wayland::selection::primary_selection::PrimarySelectionState;
use smithay::wayland::selection::wlr_data_control::DataControlState;
Expand Down Expand Up @@ -140,6 +141,7 @@ pub struct Niri {
pub input_method_state: InputMethodManagerState,
pub virtual_keyboard_state: VirtualKeyboardManagerState,
pub pointer_gestures_state: PointerGesturesState,
pub relative_pointer_state: RelativePointerManagerState,
pub data_device_state: DataDeviceState,
pub primary_selection_state: PrimarySelectionState,
pub data_control_state: DataControlState,
Expand Down Expand Up @@ -613,6 +615,7 @@ impl Niri {
let mut seat_state = SeatState::new();
let tablet_state = TabletManagerState::new::<State>(&display_handle);
let pointer_gestures_state = PointerGesturesState::new::<State>(&display_handle);
let relative_pointer_state = RelativePointerManagerState::new::<State>(&display_handle);
let data_device_state = DataDeviceState::new::<State>(&display_handle);
let primary_selection_state = PrimarySelectionState::new::<State>(&display_handle);
let data_control_state = DataControlState::new::<State, _>(
Expand Down Expand Up @@ -714,6 +717,7 @@ impl Niri {
seat_state,
tablet_state,
pointer_gestures_state,
relative_pointer_state,
data_device_state,
primary_selection_state,
data_control_state,
Expand Down

0 comments on commit 40b633b

Please sign in to comment.