1
0
Fork 0
forked from wry/wry

autocommit 2022-04-16 13:42:13 CEST

This commit is contained in:
Julian Orth 2022-04-16 13:42:13 +02:00
parent 4826305236
commit 50b792db78
27 changed files with 217 additions and 60 deletions

View file

@ -63,12 +63,17 @@ 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) {
log::warn!("Ignoring disallowed set_selection request");
return Ok(());
}
let src = if req.source.is_none() {
None
} else {
Some(self.manager.client.lookup(req.source)?)
};
self.seat.global.set_primary_selection(src)?;
self.seat.global.set_primary_selection(src, Some(req.serial))?;
Ok(())
}