mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-27 13:44:01 +00:00
2.7 KiB
2.7 KiB
Stage 30 - User-Space Window Manager (UWM) + Mouse Syscall
Goal
- Add a minimal user-space desktop environment entrypoint.
- Provide a usable user-space window manager (
uwm) with focus, dragging, resize, taskbar, and launcher. - Expose mouse snapshot data to user-space through a dedicated syscall.
Implementation
- New syscall:
- Added
MOUSE_STATE(id=107) in kernel/user syscall headers. - Kernel side (
clks/kernel/runtime/syscall.c) now exports mouse snapshot:- fields:
x,y,buttons,packet_count,ready.
- fields:
- User wrapper added:
cleonos_sys_mouse_state().
- Added
- Window protocol update:
- Added
WM_SET_FLAGS(id=114) forCLEONOS_WM_FLAG_TOPMOST. - Added
WM_RESIZE(id=115) so resize keeps the samewindow_id.
- Added
- New user app:
- Added
cleonos/c/apps/uwm_main.c. - Features:
- Bottom taskbar with window buttons.
- Start launcher menu for built-in demo windows.
- Multiple windows with z-order.
- Title bar with close, minimize, topmost, and resize controls.
- Active window focus + border highlight.
- Drag by title bar (left mouse).
- Keyboard fallback controls (
Tab,1/2/3,W/A/S/D,M,X,T,+/-,Q).
- Added
- Build integration:
- Added
uwminto shell command app set incleonos/CMakeLists.txt. - Updated shell help text and standalone
helpapp output.
- Added
- QEMU run/debug update:
- QEMU now keeps the default PS/2 mouse path enabled for
make run/make debug. - USB tablet is optional and disabled by default because the kernel currently has a PS/2 mouse driver, not a USB HID tablet driver.
- Optional absolute pointer device:
-usb -device usb-tablet
- New CMake option:
CLEONOS_QEMU_ENABLE_USB_TABLET=OFF(default).- Set it to
ONonly after USB HID tablet support is available.
- QEMU now keeps the default PS/2 mouse path enabled for
Acceptance Criteria
uwmcan be started from user shell.- UWM draws multiple windows, taskbar, and launcher, and supports dragging, minimize/restore, topmost, close, and resize.
- Mouse state is retrievable from user-space via syscall
107. make run/make debuguse the PS/2 mouse path by default so the existing kernel mouse driver receives movement and buttons.
Build Targets
make userappsmake isomake run
QEMU Command
make run
Debug Notes
- If
uwmreports framebuffer unavailable:- verify
FB_INFOsyscall is enabled and framebuffer bpp is32.
- verify
- If the UWM cursor does not move under QEMU:
- keep
CLEONOS_QEMU_ENABLE_USB_TABLET=OFF. - for manual QEMU invocation, do not include
-usb -device usb-tabletuntil USB HID support exists.
- keep
- If mouse syscall returns
ready=0:- check boot log for PS/2 mouse init status under
[INFO][MOUSE].
- check boot log for PS/2 mouse init status under