autocommit 2022-04-18 13:38:52 CEST
This commit is contained in:
parent
c11d299fb8
commit
085ca95835
12 changed files with 86 additions and 28 deletions
|
|
@ -94,7 +94,10 @@ impl WlDataDevice {
|
|||
|
||||
fn start_drag(&self, parser: MsgParser<'_, '_>) -> Result<(), StartDragError> {
|
||||
let req: StartDrag = self.manager.client.parse(self, parser)?;
|
||||
self.manager.client.validate_serial(req.serial)?;
|
||||
if !self.manager.client.valid_serial(req.serial) {
|
||||
log::warn!("Client tried to start_drag with an invalid serial");
|
||||
return Ok(());
|
||||
}
|
||||
let origin = self.manager.client.lookup(req.origin)?;
|
||||
let source = if req.source.is_some() {
|
||||
Some(self.manager.client.lookup(req.source)?)
|
||||
|
|
@ -116,7 +119,10 @@ impl WlDataDevice {
|
|||
|
||||
fn set_selection(&self, parser: MsgParser<'_, '_>) -> Result<(), SetSelectionError> {
|
||||
let req: SetSelection = self.manager.client.parse(self, parser)?;
|
||||
self.manager.client.validate_serial(req.serial)?;
|
||||
if !self.manager.client.valid_serial(req.serial) {
|
||||
log::warn!("Client tried to set_selection with an invalid serial");
|
||||
return Ok(());
|
||||
}
|
||||
if !self
|
||||
.seat
|
||||
.global
|
||||
|
|
|
|||
|
|
@ -63,7 +63,10 @@ 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.manager.client.valid_serial(req.serial) {
|
||||
log::warn!("Client tried to set_selection with an invalid serial");
|
||||
return Ok(());
|
||||
}
|
||||
if !self
|
||||
.seat
|
||||
.global
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ impl KbOwner for DefaultKbOwner {
|
|||
if old.node_id() == node.node_id() {
|
||||
return;
|
||||
}
|
||||
log::info!("unfocus {}", old.node_id());
|
||||
// log::info!("unfocus {}", old.node_id());
|
||||
if old.node_is_xwayland_surface() && !node.node_is_xwayland_surface() {
|
||||
seat.state.xwayland.queue.push(XWaylandEvent::ActivateRoot);
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ impl KbOwner for DefaultKbOwner {
|
|||
if node.node_seat_state().focus(seat) {
|
||||
node.node_active_changed(true);
|
||||
}
|
||||
log::info!("focus {}", node.node_id());
|
||||
// log::info!("focus {}", node.node_id());
|
||||
node.clone().node_focus(seat);
|
||||
seat.keyboard_node.set(node.clone());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,10 @@ impl WlPointer {
|
|||
|
||||
fn set_cursor(&self, parser: MsgParser<'_, '_>) -> Result<(), SetCursorError> {
|
||||
let req: SetCursor = self.seat.client.parse(self, parser)?;
|
||||
self.seat.client.validate_serial(req.serial)?;
|
||||
if !self.seat.client.valid_serial(req.serial) {
|
||||
log::warn!("Client tried to set_cursor with an invalid serial");
|
||||
return Ok(());
|
||||
}
|
||||
let mut cursor_opt = None;
|
||||
if req.surface.is_some() {
|
||||
let surface = self.seat.client.lookup(req.surface)?;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use {
|
|||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zwp_idle_inhibitor_v1::*, WlSurfaceId, ZwpIdleInhibitorV1Id},
|
||||
wire::{zwp_idle_inhibitor_v1::*, ZwpIdleInhibitorV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
|
|
@ -23,6 +23,7 @@ pub struct ZwpIdleInhibitorV1 {
|
|||
|
||||
impl ZwpIdleInhibitorV1 {
|
||||
fn destroy(&self, parser: MsgParser<'_, '_>) -> Result<(), ZwpIdleInhibitorV1Error> {
|
||||
log::info!("destroy {}", self.id);
|
||||
let _req: Destroy = self.client.parse(self, parser)?;
|
||||
self.client.remove_obj(self)?;
|
||||
if self.surface.idle_inhibitors.remove(&self.id).is_some() {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ impl ZwpIdleInhibitManagerV1 {
|
|||
) -> Result<(), ZwpIdleInhibitManagerV1Error> {
|
||||
let req: CreateInhibitor = self.client.parse(self, parser)?;
|
||||
let surface = self.client.lookup(req.surface)?;
|
||||
log::info!("create {}", req.id);
|
||||
let inhibit = Rc::new(ZwpIdleInhibitorV1 {
|
||||
id: req.id,
|
||||
inhibit_id: self.client.state.idle_inhibitor_ids.next(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue