From 9eb51b843905a57dbe66467348e1e1f997ab803f Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 8 Feb 2020 08:42:50 +0300 Subject: [PATCH] shell.xdg: add XdgRequest::AckConfigure This will be used for convenient resize state tracking. --- src/wayland/shell/xdg/mod.rs | 7 +++++++ src/wayland/shell/xdg/xdg_handlers.rs | 6 ++++++ src/wayland/shell/xdg/zxdgv6_handlers.rs | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/src/wayland/shell/xdg/mod.rs b/src/wayland/shell/xdg/mod.rs index a3a20da..ed757ad 100644 --- a/src/wayland/shell/xdg/mod.rs +++ b/src/wayland/shell/xdg/mod.rs @@ -941,4 +941,11 @@ pub enum XdgRequest { /// location of the menu request location: (i32, i32), }, + /// A surface has acknowledged a configure serial. + AckConfigure { + /// The surface. + surface: wl_surface::WlSurface, + /// The configure serial. + serial: u32, + }, } diff --git a/src/wayland/shell/xdg/xdg_handlers.rs b/src/wayland/shell/xdg/xdg_handlers.rs index b07c9ad..2b92d84 100644 --- a/src/wayland/shell/xdg/xdg_handlers.rs +++ b/src/wayland/shell/xdg/xdg_handlers.rs @@ -333,6 +333,12 @@ where role_data.configured = true; }) .expect("xdg_surface exists but surface has not shell_surface role?!"); + + let mut user_impl = data.shell_data.user_impl.borrow_mut(); + (&mut *user_impl)(XdgRequest::AckConfigure { + surface: data.wl_surface.clone(), + serial, + }); } _ => unreachable!(), } diff --git a/src/wayland/shell/xdg/zxdgv6_handlers.rs b/src/wayland/shell/xdg/zxdgv6_handlers.rs index fd11640..35e77f7 100644 --- a/src/wayland/shell/xdg/zxdgv6_handlers.rs +++ b/src/wayland/shell/xdg/zxdgv6_handlers.rs @@ -349,6 +349,12 @@ fn xdg_surface_implementation( role_data.configured = true; }) .expect("xdg_surface exists but surface has not shell_surface role?!"); + + let mut user_impl = data.shell_data.user_impl.borrow_mut(); + (&mut *user_impl)(XdgRequest::AckConfigure { + surface: data.wl_surface.clone(), + serial, + }); } _ => unreachable!(), }