From 70fd4ff7f6f1625a9e95a1adac5267607528fdd0 Mon Sep 17 00:00:00 2001 From: Mitchell R Date: Wed, 13 May 2026 03:37:32 +0200 Subject: [PATCH] fix(kiosk): hide the mouse cursor on every window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cage shows the pointer mid-screen by default — there's no input the user should see on a kiosk. Set GDK's "none" cursor on the pairing window and each per-display window. --- kiosk/src/ui.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kiosk/src/ui.rs b/kiosk/src/ui.rs index 8587104..75e07b9 100644 --- a/kiosk/src/ui.rs +++ b/kiosk/src/ui.rs @@ -93,6 +93,7 @@ fn activate(app: &Application) { gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, ); + hide_cursor_on(&pairing_window); show_logo(&pairing_window); pairing_window.present(); @@ -439,6 +440,7 @@ fn render_bundle( &provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, ); + hide_cursor_on(&w); w.present(); if let Some(monitor) = gdk_monitors.get(i) { w.fullscreen_on_monitor(monitor); @@ -878,6 +880,15 @@ fn ensure_warm( Some((paintable, desired_badge)) } +/// Hide the mouse pointer on a window. Kiosks have no input device the user +/// should see — the cursor is just visual noise sitting in the middle of the +/// content. GDK's "none" cursor name maps to a hidden cursor on Wayland. +fn hide_cursor_on(window: &ApplicationWindow) { + if let Some(cursor) = gtk::gdk::Cursor::from_name("none", None) { + window.set_cursor(Some(&cursor)); + } +} + fn show_logo(window: &ApplicationWindow) { let vbox = GtkBox::new(Orientation::Vertical, 0); vbox.set_valign(gtk::Align::Center);