1
0
Fork 0
forked from wry/wry

wayland: implement wlr-data-control

This commit is contained in:
Julian Orth 2024-03-31 01:36:45 +01:00
parent 8bca8b0e86
commit 99be020c19
18 changed files with 985 additions and 33 deletions

View file

@ -7,6 +7,7 @@ use {
ipc::{
wl_data_device::{ClipboardIpc, WlDataDevice},
x_data_device::{XClipboardIpc, XPrimarySelectionIpc},
zwlr_data_control_device_v1::ZwlrDataControlDeviceV1,
zwp_primary_selection_device_v1::{
PrimarySelectionIpc, ZwpPrimarySelectionDeviceV1,
},
@ -508,6 +509,17 @@ impl WlSeatGlobal {
}
}
pub fn for_each_wlr_data_device<C>(&self, ver: u32, mut f: C)
where
C: FnMut(&Rc<ZwlrDataControlDeviceV1>),
{
for dd in self.wlr_data_devices.lock().values() {
if dd.version >= ver {
f(dd);
}
}
}
fn surface_pointer_frame(&self, surface: &WlSurface) {
self.surface_pointer_event(POINTER_FRAME_SINCE_VERSION, surface, |p| p.send_frame());
}