forge
Explore
Log in

Don't you dare go Hollow

Update primary selection focus

Browse files at this commit

dbcc1182ef924329d09ee3bc3a15afa08e0e682fIvan MolodetskikhParent: 1085ea9
src/handlers/mod.rsmodified+5 -2
@@ -14,7 +14,9 @@ use smithay::wayland::data_device::{
14 ServerDndGrabHandler,14 ServerDndGrabHandler,
15 };15 };
16 use smithay::wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportError};16 use smithay::wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportError};
17-use smithay::wayland::primary_selection::{PrimarySelectionHandler, PrimarySelectionState};17+use smithay::wayland::primary_selection::{
18+ set_primary_focus, PrimarySelectionHandler, PrimarySelectionState,
19+};
18 use smithay::{20 use smithay::{
19 delegate_data_device, delegate_dmabuf, delegate_output, delegate_pointer_gestures,21 delegate_data_device, delegate_dmabuf, delegate_output, delegate_pointer_gestures,
20 delegate_presentation, delegate_primary_selection, delegate_seat, delegate_tablet_manager,22 delegate_presentation, delegate_primary_selection, delegate_seat, delegate_tablet_manager,
@@ -39,7 +41,8 @@ impl SeatHandler for State {
39 fn focus_changed(&mut self, seat: &Seat<Self>, focused: Option<&WlSurface>) {41 fn focus_changed(&mut self, seat: &Seat<Self>, focused: Option<&WlSurface>) {
40 let dh = &self.niri.display_handle;42 let dh = &self.niri.display_handle;
41 let client = focused.and_then(|s| dh.get_client(s.id()).ok());43 let client = focused.and_then(|s| dh.get_client(s.id()).ok());
42- set_data_device_focus(dh, seat, client);44+ set_data_device_focus(dh, seat, client.clone());
45+ set_primary_focus(dh, seat, client);
43 }46 }
44 }47 }
45 delegate_seat!(State);48 delegate_seat!(State);