git.lucas.co / cce-cloud
cloud storage client
git clone https://git.lucas.co/cce-cloud.git

commita23a820500a4a6acc4b289c0aa425399d960d050
parent99fb999f4a
authorLucas Galante <[email protected]>
date2026-07-14 20:11
fix: flush the Wayland connection after popup teardown in daemon mode

Dropping the popup State queues wl_surface.destroy() on the connection,
but the daemon then blocks on listener.accept() without flushing, so the
compositor never learned the surface was gone and kept displaying its
last buffer until the next popup connection flushed the socket.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/main.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/main.rs b/src/main.rs
index 8359b8c..f85e97e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2814,6 +2814,12 @@ fn run_daemon(socket_path: &str) {
         app.surface = None;
         app.state = None;
         app.cce_toplevel = None;
+
+        // Dropping the State only queues wl_surface.destroy() on the
+        // connection; the blocking accept() below would leave it unsent and
+        // the compositor would keep showing the dead popup until the next
+        // client connects.
+        let _ = conn_clone.flush();
     }
 }