1
0
Fork 0
forked from wry/wry

autocommit 2022-02-09 18:28:39 CET

This commit is contained in:
Julian Orth 2022-02-09 18:28:39 +01:00
parent 84d89afbde
commit 83c3fb99f9
11 changed files with 120 additions and 17 deletions

View file

@ -173,7 +173,6 @@ pub fn cancel_offers<T: Vtable>(src: &T::Source) {
let data = T::get_source_data(src);
while let Some((_, offer)) = data.offers.pop() {
let data = T::get_offer_data(&offer);
log::error!("cancel_offers");
data.source.take();
destroy_offer::<T>(&offer);
}
@ -268,7 +267,6 @@ fn destroy_offer<T: Vtable>(offer: &T::Offer) {
}
}
}
log::error!("destroy_offer");
if let Some(src) = data.source.take() {
let src_data = T::get_source_data(&src);
src_data.offers.remove(&T::get_offer_id(offer));

View file

@ -15,6 +15,7 @@ use crate::wire::{WlDataDeviceId, WlDataOfferId, WlSurfaceId};
use std::rc::Rc;
use thiserror::Error;
use uapi::OwnedFd;
use crate::ifs::wl_surface::{SurfaceRole, WlSurfaceError};
#[allow(dead_code)]
const ROLE: u32 = 0;
@ -86,7 +87,14 @@ impl WlDataDevice {
} else {
None
};
self.seat.global.start_drag(&origin, source)?;
let icon = if req.icon.is_some() {
let icon = self.manager.client.lookup(req.icon)?;
icon.set_role(SurfaceRole::DndIcon)?;
Some(icon)
} else {
None
};
self.seat.global.start_drag(&origin, source, icon)?;
Ok(())
}
@ -225,6 +233,8 @@ pub enum StartDragError {
#[error("Parsing failed")]
ParseFailed(#[source] Box<MsgParserError>),
#[error(transparent)]
WlSurfaceError(Box<WlSurfaceError>),
#[error(transparent)]
ClientError(Box<ClientError>),
#[error(transparent)]
WlSeatError(Box<WlSeatError>),
@ -232,6 +242,7 @@ pub enum StartDragError {
efrom!(StartDragError, ParseFailed, MsgParserError);
efrom!(StartDragError, ClientError);
efrom!(StartDragError, WlSeatError);
efrom!(StartDragError, WlSurfaceError);
#[derive(Debug, Error)]
pub enum SetSelectionError {

View file

@ -68,12 +68,6 @@ impl WlDataSource {
} else {
0
};
log::info!(
"sa = {}, ra = {}, action = {}",
server_actions,
shared.receiver_actions.get(),
action
);
if shared.selected_action.replace(action) != action {
for (_, offer) in &self.data.offers {
offer.send_action(action);