1
0
Fork 0
forked from wry/wry

ipc: remove X-only code from traits

This commit is contained in:
Julian Orth 2024-10-08 12:58:32 +02:00
parent 1ca5d43557
commit 487efafdf5
6 changed files with 9 additions and 64 deletions

View file

@ -173,14 +173,6 @@ impl IpcVtable for ClipboardIpc {
dd.seat.clone()
}
fn set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<Self::Source>,
serial: Option<u64>,
) -> Result<(), WlSeatError> {
seat.set_wl_data_source_selection(Some(source.clone()), serial)
}
fn create_offer(
device: &Rc<WlDataDevice>,
offer_data: OfferData<Self::Device>,

View file

@ -6,7 +6,7 @@ use {
x_data_offer::XDataOffer, x_data_source::XDataSource, DeviceData, IpcLocation,
IpcVtable, OfferData, Role,
},
wl_seat::{WlSeatError, WlSeatGlobal},
wl_seat::WlSeatGlobal,
},
state::State,
xwayland::XWaylandEvent,
@ -77,17 +77,6 @@ impl<T: XIpc> IpcVtable for T {
dd.seat.clone()
}
fn set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<Self::Source>,
_serial: Option<u64>,
) -> Result<(), WlSeatError> {
match source.location {
IpcLocation::Clipboard => seat.set_selection(Some(source.clone())),
IpcLocation::PrimarySelection => seat.set_primary_selection(Some(source.clone())),
}
}
fn create_offer(
dd: &Rc<Self::Device>,
data: OfferData<Self::Device>,

View file

@ -143,11 +143,6 @@ trait WlrIpc {
fn wlr_get_device_data(dd: &ZwlrDataControlDeviceV1) -> &DeviceData<ZwlrDataControlOfferV1>;
fn wlr_set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<ZwlrDataControlSourceV1>,
) -> Result<(), WlSeatError>;
fn wlr_send_selection(dd: &ZwlrDataControlDeviceV1, offer: Option<&Rc<ZwlrDataControlOfferV1>>);
fn wlr_unset(seat: &Rc<WlSeatGlobal>);
@ -161,13 +156,6 @@ impl WlrIpc for WlrClipboardIpcCore {
&dd.clipboard_data
}
fn wlr_set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<ZwlrDataControlSourceV1>,
) -> Result<(), WlSeatError> {
seat.set_selection(Some(source.clone()))
}
fn wlr_send_selection(
dd: &ZwlrDataControlDeviceV1,
offer: Option<&Rc<ZwlrDataControlOfferV1>>,
@ -188,13 +176,6 @@ impl WlrIpc for WlrPrimarySelectionIpcCore {
&dd.primary_selection_data
}
fn wlr_set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<ZwlrDataControlSourceV1>,
) -> Result<(), WlSeatError> {
seat.set_primary_selection(Some(source.clone()))
}
fn wlr_send_selection(
dd: &ZwlrDataControlDeviceV1,
offer: Option<&Rc<ZwlrDataControlOfferV1>>,
@ -229,16 +210,6 @@ impl<T: WlrIpc> IpcVtable for WlrIpcImpl<T> {
dd.seat.clone()
}
fn set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<Self::Source>,
serial: Option<u64>,
) -> Result<(), WlSeatError> {
debug_assert!(serial.is_none());
let _ = serial;
T::wlr_set_seat_selection(seat, source)
}
fn create_offer(
device: &Rc<ZwlrDataControlDeviceV1>,
offer_data: OfferData<Self::Device>,

View file

@ -121,14 +121,6 @@ impl IpcVtable for PrimarySelectionIpc {
dd.seat.clone()
}
fn set_seat_selection(
seat: &Rc<WlSeatGlobal>,
source: &Rc<Self::Source>,
serial: Option<u64>,
) -> Result<(), WlSeatError> {
seat.set_zwp_primary_selection(Some(source.clone()), serial)
}
fn create_offer(
device: &Rc<ZwpPrimarySelectionDeviceV1>,
offer_data: OfferData<Self::Device>,