server: verify selection offer is still valid when handling clipboard
Should fix #170, fix #183
This commit is contained in:
parent
2e7c318ac2
commit
cf1fae1eae
4 changed files with 49 additions and 14 deletions
|
|
@ -695,6 +695,20 @@ impl Server {
|
|||
self.display.flush_clients().unwrap();
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn empty_data_offer(&mut self) {
|
||||
let Some(dev) = &self.state.data_device else {
|
||||
panic!("No data device created");
|
||||
};
|
||||
|
||||
if let Some(selection) = self.state.selection.take() {
|
||||
selection.cancelled();
|
||||
}
|
||||
|
||||
dev.selection(None);
|
||||
self.display.flush_clients().unwrap();
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn move_pointer_to(&mut self, surface: SurfaceId, x: f64, y: f64) {
|
||||
let pointer = self.state.pointer.as_ref().expect("No pointer created");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue