1
0
Fork 0
forked from wry/wry

all: add (Clone)Cell::is_some and is_none

This commit is contained in:
Julian Orth 2024-03-02 18:09:40 +01:00
parent 7a67784502
commit 54d93f84da
32 changed files with 98 additions and 62 deletions

View file

@ -4,7 +4,10 @@ use {
ifs::wl_surface::{x_surface::XSurface, WlSurfaceError},
leaks::Tracker,
object::Object,
utils::buffd::{MsgParser, MsgParserError},
utils::{
buffd::{MsgParser, MsgParserError},
cell_ext::CellExt,
},
wire::{xwayland_surface_v1::*, XwaylandSurfaceV1Id},
},
std::rc::Rc,
@ -21,7 +24,7 @@ pub struct XwaylandSurfaceV1 {
impl XwaylandSurfaceV1 {
fn set_serial(&self, parser: MsgParser<'_, '_>) -> Result<(), XwaylandSurfaceV1Error> {
let req: SetSerial = self.client.parse(self, parser)?;
if self.x.surface.xwayland_serial.get().is_some() {
if self.x.surface.xwayland_serial.is_some() {
return Err(XwaylandSurfaceV1Error::SerialAlreadySet);
}
let serial = req.serial_lo as u64 | ((req.serial_hi as u64) << 32);

View file

@ -202,7 +202,7 @@ impl Xwindow {
surface: &Rc<WlSurface>,
) -> Result<Rc<Self>, XWindowError> {
let xsurface = surface.get_xsurface()?;
if xsurface.xwindow.get().is_some() {
if xsurface.xwindow.is_some() {
return Err(XWindowError::AlreadyAttached);
}
let tld = ToplevelData::new(
@ -235,11 +235,11 @@ impl Xwindow {
}
pub fn is_mapped(&self) -> bool {
self.toplevel_data.parent.get().is_some() || self.display_link.borrow_mut().is_some()
self.toplevel_data.parent.is_some() || self.display_link.borrow_mut().is_some()
}
pub fn may_be_mapped(&self) -> bool {
self.x.surface.buffer.get().is_some() && self.data.info.mapped.get()
self.x.surface.buffer.is_some() && self.data.info.mapped.get()
}
fn map_change(&self) -> Change {