1
0
Fork 0
forked from wry/wry

xdg-shell: make acked serial part of the pending state

This commit is contained in:
Julian Orth 2025-09-19 12:27:42 +02:00
parent c9f54cd60b
commit 17ac4ca0e1
7 changed files with 85 additions and 36 deletions

View file

@ -50,7 +50,7 @@ impl TestXdgWmBase {
tran: self.tran.clone(),
_server: server,
destroyed: Cell::new(false),
last_serial: Cell::new(0),
last_serial: Default::default(),
});
self.tran.add_obj(xdg.clone())?;
Ok(xdg)

View file

@ -19,7 +19,7 @@ pub struct TestXdgSurface {
pub tran: Rc<TestTransport>,
pub _server: Rc<XdgSurface>,
pub destroyed: Cell<bool>,
pub last_serial: Cell<u32>,
pub last_serial: Cell<Option<u32>>,
}
impl TestXdgSurface {
@ -63,7 +63,7 @@ impl TestXdgSurface {
fn handle_configure(&self, parser: MsgParser<'_, '_>) -> Result<(), TestError> {
let ev = Configure::parse_full(parser)?;
self.last_serial.set(ev.serial);
self.last_serial.set(Some(ev.serial));
Ok(())
}
}

View file

@ -15,7 +15,9 @@ pub struct TestWindow {
impl TestWindow {
pub async fn map(&self) -> Result<(), TestError> {
self.xdg.ack_configure(self.xdg.last_serial.get())?;
if let Some(serial) = self.xdg.last_serial.take() {
self.xdg.ack_configure(serial)?;
}
self.surface
.map(self.tl.core.width.get(), self.tl.core.height.get())
.await?;