1
0
Fork 0
forked from wry/wry

ipc: remove DynDataSource::offer_to_regular/wlr

This commit is contained in:
Julian Orth 2024-10-08 14:51:37 +02:00
parent 487efafdf5
commit 40f7bc2542
8 changed files with 31 additions and 110 deletions

View file

@ -3,7 +3,11 @@ use {
client::{Client, ClientCaps, ClientError, CAP_DATA_CONTROL_MANAGER},
globals::{Global, GlobalName},
ifs::ipc::{
zwlr_data_control_device_v1::{ZwlrDataControlDeviceV1, PRIMARY_SELECTION_SINCE},
offer_source_to_wlr_device,
zwlr_data_control_device_v1::{
WlrClipboardIpc, WlrPrimarySelectionIpc, ZwlrDataControlDeviceV1,
PRIMARY_SELECTION_SINCE,
},
zwlr_data_control_source_v1::ZwlrDataControlSourceV1,
},
leaks::Tracker,
@ -78,12 +82,12 @@ impl ZwlrDataControlManagerV1RequestHandler for ZwlrDataControlManagerV1 {
seat.global.add_wlr_device(&dev);
self.client.add_client_obj(&dev)?;
match seat.global.get_selection() {
Some(s) => s.offer_to_wlr_device(&dev),
Some(s) => offer_source_to_wlr_device::<WlrClipboardIpc>(s, &dev),
_ => dev.send_selection(None),
}
if self.version >= PRIMARY_SELECTION_SINCE {
match seat.global.get_primary_selection() {
Some(s) => s.offer_to_wlr_device(&dev),
Some(s) => offer_source_to_wlr_device::<WlrPrimarySelectionIpc>(s, &dev),
_ => dev.send_primary_selection(None),
}
}