mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Set data device focus on focus change
Fixes clipboard.
This commit is contained in:
+10
-4
@@ -4,10 +4,11 @@ mod xdg_shell;
|
||||
|
||||
//
|
||||
// Wl Seat
|
||||
use smithay::input::{SeatHandler, SeatState};
|
||||
use smithay::input::{Seat, SeatHandler, SeatState};
|
||||
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
|
||||
use smithay::reexports::wayland_server::Resource;
|
||||
use smithay::wayland::data_device::{
|
||||
ClientDndGrabHandler, DataDeviceHandler, ServerDndGrabHandler,
|
||||
set_data_device_focus, ClientDndGrabHandler, DataDeviceHandler, ServerDndGrabHandler,
|
||||
};
|
||||
use smithay::{delegate_data_device, delegate_output, delegate_seat};
|
||||
|
||||
@@ -23,11 +24,16 @@ impl SeatHandler for Niri {
|
||||
|
||||
fn cursor_image(
|
||||
&mut self,
|
||||
_seat: &smithay::input::Seat<Self>,
|
||||
_seat: &Seat<Self>,
|
||||
_image: smithay::input::pointer::CursorImageStatus,
|
||||
) {
|
||||
}
|
||||
fn focus_changed(&mut self, _seat: &smithay::input::Seat<Self>, _focused: Option<&WlSurface>) {}
|
||||
|
||||
fn focus_changed(&mut self, seat: &Seat<Self>, focused: Option<&WlSurface>) {
|
||||
let dh = &self.display_handle;
|
||||
let client = focused.and_then(|s| dh.get_client(s.id()).ok());
|
||||
set_data_device_focus(dh, seat, client);
|
||||
}
|
||||
}
|
||||
|
||||
delegate_seat!(Niri);
|
||||
|
||||
Reference in New Issue
Block a user