aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/mod.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-08-07 19:44:40 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-08-10 14:49:38 +0400
commitad3c3f8cefd38d2bf26b466d8e34eccde3bca443 (patch)
tree5783df13fa895bb6a8244556fb31b6504312b82b /src/handlers/mod.rs
downloadniri-ad3c3f8cefd38d2bf26b466d8e34eccde3bca443.tar.gz
niri-ad3c3f8cefd38d2bf26b466d8e34eccde3bca443.tar.bz2
niri-ad3c3f8cefd38d2bf26b466d8e34eccde3bca443.zip
Init from smallvil
Diffstat (limited to 'src/handlers/mod.rs')
-rw-r--r--src/handlers/mod.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
new file mode 100644
index 00000000..bc2cd23f
--- /dev/null
+++ b/src/handlers/mod.rs
@@ -0,0 +1,54 @@
+mod compositor;
+mod xdg_shell;
+
+use crate::Smallvil;
+
+//
+// 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};
+
+impl SeatHandler for Smallvil {
+ type KeyboardFocus = WlSurface;
+ type PointerFocus = WlSurface;
+
+ fn seat_state(&mut self) -> &mut SeatState<Smallvil> {
+ &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!(Smallvil);
+
+//
+// Wl Data Device
+//
+
+impl DataDeviceHandler for Smallvil {
+ type SelectionUserData = ();
+ fn data_device_state(&self) -> &smithay::wayland::data_device::DataDeviceState {
+ &self.data_device_state
+ }
+}
+
+impl ClientDndGrabHandler for Smallvil {}
+impl ServerDndGrabHandler for Smallvil {}
+
+delegate_data_device!(Smallvil);
+
+//
+// Wl Output & Xdg Output
+//
+
+delegate_output!(Smallvil);