blob: 4ad355cab627b7a48bf5fd79cba52edbc3f7f6b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
mod compositor;
mod layer_shell;
mod xdg_shell;
//
// Wl Seat
use smithay::input::{SeatHandler, SeatState};
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
use smithay::wayland::data_device::{
ClientDndGrabHandler, DataDeviceHandler, ServerDndGrabHandler,
};
use smithay::{delegate_data_device, delegate_output, delegate_seat};
use crate::Niri;
impl SeatHandler for Niri {
type KeyboardFocus = WlSurface;
type PointerFocus = WlSurface;
fn seat_state(&mut self) -> &mut SeatState<Niri> {
&mut self.seat_state
}
fn cursor_image(
&mut self,
_seat: &smithay::input::Seat<Self>,
_image: smithay::input::pointer::CursorImageStatus,
) {
}
fn focus_changed(&mut self, _seat: &smithay::input::Seat<Self>, _focused: Option<&WlSurface>) {}
}
delegate_seat!(Niri);
//
// Wl Data Device
//
impl DataDeviceHandler for Niri {
type SelectionUserData = ();
fn data_device_state(&self) -> &smithay::wayland::data_device::DataDeviceState {
&self.data_device_state
}
}
impl ClientDndGrabHandler for Niri {}
impl ServerDndGrabHandler for Niri {}
delegate_data_device!(Niri);
//
// Wl Output & Xdg Output
//
delegate_output!(Niri);
|