summaryrefslogtreecommitdiffstats
path: root/rsnix/src/wm.rs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* wm: fix usize underflow in move_window at screen edgessalmonik2026-08-211-3/+4
| | | | | | | | ox.saturating_sub(pad) / oy.saturating_sub(pad) — plain subtraction on usize wraps to usize::MAX when the window sits at x=0 or y=0, causing composite_rect to draw at the far end of the framebuffer instead of near the window. Also broke drag-to-move when stuck against the top or left edge.
* wm: 1px focus-colored border + flush full window on focus changesalmonik2026-08-211-8/+57
| | | | | | | | | | - draw_window_border(): 1px border around every window except the root. Blue (TITLE_BG_FOCUS) when focused, grey (TITLE_BG) when not. - focus() / focus_console(): composite the full window area + border pad on both the old and new focused windows (was title-bar-only before). - flush(): include border pad in the damage rectangle. - move_window(): redraw border area at old and new positions. - Remove redundant term.flush() from tty Focus handler (focus() covers it).
* v0.5.11: fix terminal focus — toggle ACTIVE on Focus messagessalmonik2026-08-211-5/+3
| | | | | | | | | | - tty: read_line_from_queue() now takes &mut Terminal and handles TaskMsg::Focus: Focus(true) sets ACTIVE to the terminal, Focus(false) clears it. This fixes the bug where the console shell's gop_print! output was redirected to the soft terminal even after focus switched away from it. - shell: run_windowed() passes the terminal through to read_line_from_queue. - wm: remove noisy per-key debug logging from pump_main.
* wm: F1 spawns a windowed shell — real shell, not a duplicatesalmonik2026-08-201-1/+15
| | | | | | | | | | | | | | | | | Architecture: - vt: ACTIVE terminal redirect — when set, all gop_print!/put_char/write_str go there instead of HOME. Terminal::from_buffer() renders into a WM-owned pixel buffer. - tty: read_line_from_queue() — canonical-mode line input from the task's own message queue (TaskMsg::Key). Returns None on Close. - shell: run_windowed() — same shell as the console but reads from the message queue. Returns on ^D or window close. - wm: F1 calls SPAWN_TERMINAL_CB (set by rsdos). No shell logic in the WM. - rsdos: terminal_task callback + terminal_entry task — creates a 640x400 chrome window, wires up Terminal::from_buffer, sets ACTIVE, runs shell::run_windowed(), cleans up on exit. - shell: 'term' debug command that invokes the callback directly and logs each step to serial.
* wm: integrate home terminal as window 0 + fix console focus after closesalmonik2026-08-191-201/+241
| | | | | | | | | | | | | | | | | | - 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.
* vt → per-instance Terminal rendering into a pixel buffersalmonik2026-08-171-16/+0
| | | | | | | | | | | - Refactor vt.rs into a per-instance Terminal struct (owned cell/rendered grids, cursor, ANSI parser, scroll state), rendering glyphs into a caller-owned pixel buffer with dirty-region blitting - Add gop buffer primitives (buffer_glyph_px, buffer_shift_up) and keep the legacy vt:: API as thin wrappers around the home terminal - Remove the now-obsolete scroll hook and shadow scroll path - Home terminal renders into its own buffer; window_id stays None until the WM integration lands
* wm: keep windows in place when the console scrolls beneath themsalmonik2026-08-171-0/+16
| | | | | | | The console's batched scroll (gop::shift_up_n) shifts the whole shared shadow, which dragged any composited window pixels up with it. Add a scroll hook so the window manager re-composites every visible window after a console scroll, restoring them at their fixed positions.
* wm: title-bar drag-to-move; stop delivering title-bar gestures to appssalmonik2026-08-171-20/+106
| | | | | | | | | - Track the active mouse gesture (none / window-move / app-stroke) so a press on the title bar becomes a move drag instead of leaking Move events into the app's content - Add move_window (clamped to the canvas, repaint old + new regions) - Always deliver MouseKind::Release so a stroke that ends outside the window still terminates
* Windowed GUI: wm module, input routing, and the paint appsalmonik2026-08-171-0/+592
- Add the wm window-manager facility per ADR 0004: overlapping pixel-surface windows, damage-rectangle compositing, WM-drawn title bar, focus/minimize/close, and F1-F4 keybindings - Add gop shadow compositing primitives and vt::repaint_region so the console stays layer 0 beneath windows - Route mouse (absolute coords, press/release edges) and keyboard (focus-aware input pump) to the focused window - Add the rspaint drawing-program crate (pen, 8 colors, clear) and shell draw/windows/restore commands - Extend TaskMsg with AppMouse/Focus/Close and document the design in CONTEXT.md + ADR 0004