aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-26 22:22:11 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-26 22:22:11 +0400
commit93369e1958e995d9ad487bb1e33a1bfb9afabb2e (patch)
tree0efa175df0c91a20fcba9a6144848862e953a765 /src/handlers
parentd3735227cec6439d36cd2f6061df5dbc7cc9bc19 (diff)
downloadniri-93369e1958e995d9ad487bb1e33a1bfb9afabb2e.tar.gz
niri-93369e1958e995d9ad487bb1e33a1bfb9afabb2e.tar.bz2
niri-93369e1958e995d9ad487bb1e33a1bfb9afabb2e.zip
Implement primary selecton
Firefox clipboard doesn't always work without it.
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index e99cc5ce..87a0267d 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -14,9 +14,10 @@ use smithay::wayland::data_device::{
ServerDndGrabHandler,
};
use smithay::wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportError};
+use smithay::wayland::primary_selection::{PrimarySelectionHandler, PrimarySelectionState};
use smithay::{
delegate_data_device, delegate_dmabuf, delegate_output, delegate_pointer_gestures,
- delegate_presentation, delegate_seat, delegate_tablet_manager,
+ delegate_presentation, delegate_primary_selection, delegate_seat, delegate_tablet_manager,
};
use crate::niri::State;
@@ -75,6 +76,15 @@ impl ServerDndGrabHandler for State {}
delegate_data_device!(State);
+impl PrimarySelectionHandler for State {
+ type SelectionUserData = ();
+
+ fn primary_selection_state(&self) -> &PrimarySelectionState {
+ &self.niri.primary_selection_state
+ }
+}
+delegate_primary_selection!(State);
+
delegate_output!(State);
delegate_presentation!(State);