From 09a44f15678f27dd3d07f90e9ed0e71cf0e771ff Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 19 Aug 2026 18:46:35 +0200 Subject: wm: integrate home terminal as window 0 + fix console focus after close - wm rewrite: chrome flag per window, create_home_window for the console (window 0, chrome-less, bottom-pinned, never closed), composite_rect fills desktop background then blits windows bottom-to-top, draw_window_intersect handles chrome-less windows, hit_test returns Content for chrome-less, destroy/move_window no-op for id 0. - vt: add window_params() so main.rs can wire the Terminal to wm window 0. - main.rs: create home terminal window 0 and attach Terminal after wm::init(). - Focus fix: focus(0) now stores CONSOLE sentinel (not raw 0) so focused() returns None when the home terminal has focus. Without this, closing a GUI window left FOCUSED=0, which tty::poll_key() interpreted as 'a GUI app has focus', spinning forever and swallowing all keyboard input. --- rsdos/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rsdos') diff --git a/rsdos/src/main.rs b/rsdos/src/main.rs index b147e63..6d2fa4a 100644 --- a/rsdos/src/main.rs +++ b/rsdos/src/main.rs @@ -413,6 +413,12 @@ pub unsafe extern "efiapi" fn efi_main(image_handle: Handle, system_table: *mut // Windowed GUI: initialise the window manager and its input pump. // The console (vt) stays layer 0; GUI apps are windows composited on top. rsnix::wm::init(); + { + let t = rsnix::vt::home_terminal(); + let (buf, w, h) = t.window_params(); + let id = rsnix::wm::create_home_window(buf as *mut u32, w, h); + t.set_window(id); + } rsnix::wm::spawn_input_pump(); shell::run(); -- cgit v1.2.3