From 92be3d6db17136f6a416dbb5a9764b0031f675bb Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 14 Sep 2024 16:34:03 +0200 Subject: [PATCH] xdg_surface: send initial configure once after the initial commit --- src/ifs/wl_surface/xdg_surface.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ifs/wl_surface/xdg_surface.rs b/src/ifs/wl_surface/xdg_surface.rs index 5a23c9fa..2821bfe4 100644 --- a/src/ifs/wl_surface/xdg_surface.rs +++ b/src/ifs/wl_surface/xdg_surface.rs @@ -75,6 +75,7 @@ pub struct XdgSurface { popups: CopyHashMap>, pub workspace: CloneCell>>, pub tracker: Tracker, + have_initial_commit: Cell, } struct Popup { @@ -190,6 +191,7 @@ impl XdgSurface { popups: Default::default(), workspace: Default::default(), tracker: Default::default(), + have_initial_commit: Default::default(), } } @@ -489,16 +491,11 @@ impl SurfaceExt for XdgSurface { self: Rc, pending: &mut PendingState, ) -> Result<(), WlSurfaceError> { - { - let ase = self.acked_serial.get(); - let rse = self.requested_serial.get(); - if ase != Some(rse) { - if ase.is_none() { - if let Some(ext) = self.ext.get() { - ext.initial_configure()?; - } - self.send_configure(rse); - } + if !self.have_initial_commit.get() { + if let Some(ext) = self.ext.get() { + ext.initial_configure()?; + self.do_send_configure(); + self.have_initial_commit.set(true); } } if let Some(pending) = &mut pending.xdg_surface {