Impossible OS Docs

Desktop Shell Today

What is it?

The desktop shell is everything drawn behind and around the windows: the wallpaper, the desktop icons, the taskbar with its Start button, window buttons and clock, and the Start menu. Today it all lives in one file, desktop.c. This roadmap planned to make it interactive (icon launching, a desktop right-click menu, taskbar window state, Start menu launching, power and settings buttons), but it is superseded: each behaviour is owned in the graphics roadmaps and built to the shell design. This page describes what the shell does now.

How does it work?

The compositor calls the shell's draw functions every frame, and gives it the first look at every mouse event through desktop_handle_click(); the window manager only sees a click the shell did not take.

  • Wallpaper. Read at startup from the Registry values Wallpaper and WallpaperMode under HKLM\SYSTEM\Theme, defaulting to C:\Impossible\Web\Wallpaper\default.jpg. It is decoded, scaled to the screen with one of five fit modes (fill, fit, center, tile, stretch) and cached; a gradient is drawn if loading fails.
  • Desktop icons. Three fixed icons, Computer, Recycle Bin and Control Panel, drawn at 48 pixels in a column on the right edge with a shadowed 14 pixel label. They are pictures only: clicking them does nothing. See Desktop Icons.
  • Taskbar. 48 pixels tall (TASKBAR_HEIGHT in desktop.h) with a frosted acrylic background. From the left: the Start button with the logo, a 100 pixel button per open window with the focused one highlighted, and on the right a two-line clock (12-hour time over the date). Clicking a window button raises and focuses that window; it never minimizes it.
  • Start menu. A fixed two-column menu, 450 pixels wide. The left column has a search box that does not search yet and three entries: About (opens a small information window), All Programs (does nothing) and Terminal (opens the Command Prompt). The right column lists Computer, Documents, Pictures, Music, Downloads, Control Panel and Help, which highlight on hover but do nothing when clicked. At the bottom, Settings closes the menu and Power shuts the machine down immediately through acpi_shutdown(), with no confirmation and no restart or sleep choice.
  • Right-click. Ignored everywhere on the desktop.
flowchart LR
    C[compositor frame] --> W[wallpaper] --> I[3 static icons] --> Win[windows] --> T[taskbar] --> S[Start menu if open]
    M[mouse event] --> H{desktop_handle_click}
    H -- Start, taskbar, menu --> A[shell action]
    H -- otherwise --> WM[window manager]

What are its interfaces?

Interface Purpose
desktop_init() Load the wallpaper at startup (desktop.h)
desktop_draw_wallpaper(), desktop_draw_icons(), desktop_draw_taskbar(), desktop_draw_start_menu() Called by wm_composite()
desktop_handle_click() First refusal on every mouse event
desktop_get_cursor_context() Hand cursor over clickable areas
desktop_get_usable_height() Screen height minus the taskbar
HKLM\SYSTEM\Theme\Wallpaper, WallpaperMode Wallpaper settings

How do I use it?

Boot the desktop (bash scripts/build.sh run), click Start, and choose Terminal to open the Command Prompt or About for version information. The wallpaper cannot be changed persistently yet: every boot re-seeds the Registry defaults and saved hives are never loaded.

What is not implemented yet?

How does it compare with Windows 11 and Linux?

Windows 11 launches desktop icons, has a desktop context menu, minimizes and restores from taskbar buttons, and offers Shut down, Restart and Sleep from Start. GNOME launches from Activities and its dash and has the same power choices. Impossible OS draws a working taskbar and a Windows 7 style Start menu that can launch two items and power off; the Windows 11 layout in the Start menu design replaces it.

See also

Impossible OS is free software under the GPL-3.0-only license. Last updated Edit this page on GitHub