git.lucas.co / cce-authenticator
login authentication (PAM + fingerprint)
git clone https://git.lucas.co/cce-authenticator.git

commit8b43e062d24bc2baee803581bbc1c8fb2cf83a72
parent6b6003c505
authorLucas Galante <[email protected]>
date2026-08-22 13:17
feat: declare the prompt a Utility window — it shouldn't inherit a size

The compositor restores a saved size per app_id over the client's request, so
the prompt came back at whatever it was last left at. That is wrong for a
modal in a way it is not for an ordinary tool: a prompt is not something the
user chose to open at a size, it is something that appeared. Utility means no
geometry is saved for it, so none can be restored — every prompt is the shape
this dialog asks for. It also drops the resize affordance (the whole border
band moves the window, and there is nothing here worth resizing: two fixed
columns and a status shelf) and keeps the window out of the overview
displacement.

Needs cce-compositor@a06a8be, which stops `try_center_on_view` stripping the
mode at map. Placement stays the compositor's — that function owns the
position and is exempt from Utility's self-sizing for position only. On a
compositor too old for the manager-v5 declaration this degrades to a plain
floating window, by design.

Shadow-verified: mode=Utility, centered at its own 640x360, a border drag
moves without resizing, and no state.json entry survives the session.

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

diff --git a/src/main.rs b/src/main.rs
index bb15c96..ecfb766 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -399,6 +399,25 @@ impl Application for AuthenticatorApp {
         }
     }
 
+    /// A session modal is a utility window: two fixed columns and a status
+    /// shelf, nothing worth resizing, and nothing it should ever inherit.
+    ///
+    /// The size matters more here than for an ordinary tool. The compositor
+    /// restores a saved size per app_id over the client's request, so before
+    /// this the prompt came back at whatever it was last left at — and a
+    /// prompt is not something the user chose to open at a size, it is
+    /// something that appeared. Utility means no geometry is saved for it, so
+    /// none can be restored: every prompt is the shape this dialog asks for.
+    /// It also drops the resize affordance (the whole border band moves it)
+    /// and keeps the window out of the overview displacement.
+    ///
+    /// Placement stays the compositor's — `Window::try_center_on_view` centers
+    /// this app_id on the current view, and it is exempt from Utility's
+    /// self-sizing for position only.
+    fn utility(&self) -> bool {
+        true
+    }
+
     fn update(&mut self, msg: Self::Message, needs_rebuild: &mut bool, exit: &mut bool) {
         *needs_rebuild = true;
         match msg {