1
0
Fork 0
forked from wry/wry

autocommit 2022-04-17 17:08:31 CEST

This commit is contained in:
Julian Orth 2022-04-17 17:08:31 +02:00
parent 50b792db78
commit a30306e3d5
23 changed files with 390 additions and 42 deletions

View file

@ -61,7 +61,14 @@ impl WlDataDevice {
self.manager.client.event(Leave { self_id: self.id })
}
pub fn send_enter(&self, surface: WlSurfaceId, x: Fixed, y: Fixed, offer: WlDataOfferId, serial: u32) {
pub fn send_enter(
&self,
surface: WlSurfaceId,
x: Fixed,
y: Fixed,
offer: WlDataOfferId,
serial: u32,
) {
self.manager.client.event(Enter {
self_id: self.id,
serial,

View file

@ -64,7 +64,11 @@ impl ZwpPrimarySelectionDeviceV1 {
fn set_selection(&self, parser: MsgParser<'_, '_>) -> Result<(), SetSelectionError> {
let req: SetSelection = self.manager.client.parse(self, parser)?;
self.seat.client.validate_serial(req.serial)?;
if !self.seat.global.may_modify_primary_selection(&self.seat.client, req.serial) {
if !self
.seat
.global
.may_modify_primary_selection(&self.seat.client, req.serial)
{
log::warn!("Ignoring disallowed set_selection request");
return Ok(());
}
@ -73,7 +77,9 @@ impl ZwpPrimarySelectionDeviceV1 {
} else {
Some(self.manager.client.lookup(req.source)?)
};
self.seat.global.set_primary_selection(src, Some(req.serial))?;
self.seat
.global
.set_primary_selection(src, Some(req.serial))?;
Ok(())
}