PeekDesktop: macOS Sonoma-Style Desktop Reveal for Windows
PeekDesktop: Recreating macOS Sonoma’s Click-to-Reveal Desktop on Windows
Overview PeekDesktop is a Windows utility that brings the familiar macOS Sonoma feature—clicking an empty part of the wallpaper to reveal the desktop—into Windows 10 and 11. By default it honors Windows’ native Show Desktop behavior, so you can click the wallpaper to vanish all open windows, then click again to restore everything exactly as you left it. PeekDesktop offers an optional Fly Away style for a playful visual flourish, plus a robust set of tray toggles to tailor how and when it activates. You can click or drag desktop icons normally without accidentally triggering the peek, and when you’re done, a simple click on a window, the taskbar, or the wallpaper returns you to your workspace exactly where you left off.
Visual demonstration A short demonstration GIF in the input shows PeekDesktop in action: windows minimize when the wallpaper is clicked, revealing the icons and the desktop underneath. This visual cue illustrates the core behavior—a seamless reveal and restore that preserves window positions and states.
Download and installation PeekDesktop is delivered in multiple convenient ways, making it easy to get started on most Windows machines.
- Download the latest release
- A direct link is provided to fetch the most recent version.
- Install with Winget
- PeekDesktop is submitted to the Windows Package Manager community repository as Hanselman.PeekDesktop when a tagged release is published.
- After the manifest is accepted, install it with: winget install Hanselman.PeekDesktop
- Download a release (zip)
- PeekDesktop-vX.Y.Z-win-x64.zip for Intel/AMD PC.
- PeekDesktop-vX.Y.Z-win-arm64.zip for ARM64 devices such as Surface Pro X or certain Snapdragon-powered machines.
- No installer required
- The zip can be extracted and PeekDesktop.exe run directly.
- Self-contained and automatic updates
- Release builds are self-contained; no .NET installation is required.
- PeekDesktop lives in the system tray and updates itself automatically—new versions are downloaded, verified for code-signature, and restarted in place.
A practical note about the auto-updater PeekDesktop’s in-place auto-updater is designed to be seamless. It downloads the new package, verifies the Authenticode signature, swaps the running instance, and restarts without user intervention. This minimizes disruption and keeps the experience smooth across versions.
Documentation and deeper dives For developers or power users who want to understand the internals, there are two key documentation bundles:
- Engineering Deep Dive
- An in-depth look at the architecture, shell internals, experimental features, debugging workflow, undocumented API notes, and tradeoffs during releases.
- Auto-Updater
- Details on how the in-place auto-update mechanism works, the security model, swap dance, and testing strategies.
How it works in practice Three simple steps capture the core workflow:
1) Click an empty desktop wallpaper or an empty area of the taskbar (not an icon or a taskbar button) to reveal the desktop. 2) Stay on the desktop to move icons, right-click, or rearrange items while windows remain hidden. 3) Click any app, the taskbar, or the empty wallpaper again to restore all windows to their exact previous positions.
Peek styles and visual behavior PeekDesktop offers two primary styles for the visual experience:
- Show Desktop (Explorer)
- This is the default and recommended mode.
- It leverages Explorer’s native Show Desktop functionality to minimize and restore windows in a familiar, stable manner.
- Fly Away (Experimental)
- An animation-driven option that visually slides windows offscreen.
- It’s designed for flair and experimentation but can interact oddly with external window management or shell behavior (e.g., Win+D or taskbar changes) if the shell rearranges windows during peeking.
- Use this for moments when you want a more dramatic reveal, keeping in mind potential quirks with certain workflows or third-party window managers.
Under the hood: how PeekDesktop works PeekDesktop relies on a small, efficient set of Windows APIs designed for minimal overhead and reliable behavior.
- SetWindowsHookEx(WHMOUSELL)
- A low-level mouse hook to detect clicks on the desktop, including empty wallpaper areas.
- WindowFromPoint
- Identifies the window currently under the cursor, helping to distinguish between wallpaper, icons, and other UI elements.
- MSAA hit-testing (AccessibleObjectFromPoint)
- Helps distinguish empty wallpaper from desktop icons, ensuring that clicks on icons do not trigger a peek.
- UI Automation hit-testing
- Classifies empty taskbar space without inadvertently triggering on Start, pinned apps, or tray buttons.
- Taskbar Show Desktop button click
- The primary path for Show Desktop behavior, immune to keyboard remapping and other shortcuts that might be installed by tools like PowerToys.
- Win+D SendInput
- A fallback path when the taskbar button is unavailable.
- EnumWindows + WINDOWPLACEMENT
- Captures the exact position and state (including maximized) of every window so it can be restored precisely.
- SetWinEventHook(EVENTSYSTEMFOREGROUND)
- Watches for app switches to know when the user returns to a previous context.
- SetWindowPlacement
- Restores windows to their exact prior positions and states.
- No admin rights required
- PeekDesktop operates with standard user privileges.
- Low memory footprint
- Idle RAM usage is measured in the low single-digit megabytes.
System tray: options at a glance The tray icon is the control hub for PeekDesktop, offering a compact, user-friendly interface:
- Enabled
- Toggle the peek feature on or off.
- Start with Windows
- Auto-launch PeekDesktop at login.
- Require Double-Click
- Optional double-click on the desktop to trigger peek.
- Pause While Gaming / Full-Screen
- Automatically pause peeking during exclusive full-screen activities and known gaming fullscreen apps.
- Peek on Desktop Click
- Enabled by default; you can disable this to restrict peeking to the taskbar or other triggers.
- Peek on Taskbar Click
- Optional trigger from empty space on the taskbar.
- Restore All Windows on App Switch
- Activated by default; in Explorer’s Show Desktop mode, taskbar or Alt+Tab app switches restore all hidden windows behind the selected app.
- Peek Style
- Lets you switch between Explorer Show Desktop behavior and Fly Away mode.
- About
- Version information for quick reference.
- Check for Updates
- Automatically download and install newer versions.
- Auto-Check for Updates
- Enabled by default; silently checks updates on startup.
- Exit
- Quit PeekDesktop.
Visual themes and system integration When Windows is using dark mode, the tray menu follows the system theme as supported by the OS. This keeps UI elements cohesive with the active Windows theme.
What’s new PeekDesktop evolves with small, meaningful improvements that broaden its versatility and compatibility:
- Small Native AOT single-file builds for both x64 and ARM64
- Peek on Taskbar Click
- An optional trigger from empty taskbar space expands how you can initiate peeking.
- Taskbar-only activation
- You can disable desktop-click peeking while keeping taskbar peeking enabled.
- Dark tray menu support
- Tray menu adheres to Windows dark mode where available.
- Taskbar button Show Desktop
- Bypasses keyboard remappers (e.g., those installed by PowerToys Keyboard Manager).
- Pause While Gaming / Full-Screen
- Reduces interference during gaming sessions.
- Require Double-Click
- Toggle an optional double-click trigger for desktop peek.
- In-place auto-updater
- Downloads, verifies the Authenticode signature, swaps, and restarts automatically.
macOS Sonoma vs PeekDesktop: a quick comparison PeekDesktop mirrors many of the core features popularized by macOS Sonoma, but with Windows-specific adaptations and a Windows-native implementation. Key points of parity include:
- Click wallpaper to peek
- Both systems support revealing the desktop by clicking on the wallpaper.
- Restore on app click
- Clicking or focusing an application restores windows to their previous arrangement.
- Restore on second wallpaper click
- A second click can restore all windows, bringing the workspace back to its exact state.
- Click to move or drag icons without triggering peek
- Desktop icons remain interactive during peeking.
- Accessible desktop icons
- You retain access to icons and the desktop environment while peeking.
- Exact window position restoration
- The restoration process preserves window placement precisely.
- System tray control
- PeekDesktop adds a centralized control via the tray icon, while macOS Sonoma does not have a Windows-style system tray.
- Multi-monitor support
- Both environments handle multi-monitor configurations, with PeekDesktop focusing on per-monitor accuracy for minimization and restoration.
- Start with OS vs registry
- macOS Sonoma is tightly integrated with macOS startup items, while PeekDesktop leverages Windows startup mechanisms (Registry-based launch).
Build from source: a developer’s perspective If you want to build PeekDesktop from source, here are the condensed steps and essentials drawn from the input.
Requirements
- .NET 10 SDK
- The project is designed to be built with .NET 10 and beyond.
Build and run
- Clone and build
- git clone https://github.com/shanselman/PeekDesktop.git
- cd PeekDesktop
- dotnet build src/PeekDesktop/PeekDesktop.csproj
- Run for testing
- dotnet run --project src/PeekDesktop/PeekDesktop.csproj
- This runs the P/Invoke safety harness to stress-test handles, etc.
- Optional Windows-friendly wrapper
- A sample test script can be used to run repeated iterations, with verbose timing and leak diagnostics if desired (e.g., test.ps1).
Publish a self-contained single-file exe
- For Intel/AMD
- dotnet publish src/PeekDesktop/PeekDesktop.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true
- For ARM64
- dotnet publish src/PeekDesktop/PeekDesktop.csproj -c Release -r win-arm64 --self-contained -p:PublishSingleFile=true Note: Current releases favor a self-contained single-file approach to simplify deployment and avoid runtime dependencies.
Release packaging and native AOT
- Release builds use .NET Native AOT
- The final binary is a fully native executable with no .NET runtime requirement.
- Historical context
- Earlier experiments explored various packaging strategies, including PublishAotCompressed.
Developer architecture: a quick map The codebase is organized to separate concerns and enable a focused feature set:
- Program.cs
- Entry point and single-instance mutex
- DesktopPeek.cs
- Core state machine (Idle ↔ Peeking)
- MouseHook.cs
- WHMOUSELL global mouse hook
- FocusWatcher.cs
- MONITORS for foreground changes
- WindowTracker.cs
- Enumerates, minimizes, and restores windows
- DesktopDetector.cs
- Identifies desktop windows, icons, and the taskbar
- Win32MessageLoop.cs
- Main Win32 message loop and recovery handling
- Win32TrayIcon.cs
- Shell_NotifyIcon wrapper
- Win32Menu.cs
- Win32 popup menus
- Win32Icon.cs
- Programmatic icon creation via CreateIconIndirect
- WinHttp.cs
- OS-native WinHTTP wrapper (replacing HttpClient)
- TrayIcon.cs
- Tray icon logic and menu wiring
- AppUpdater.cs
- In-place auto-updater
- AppDiagnostics.cs
- Logging and diagnostics
- Settings.cs
- Hand-written UTF-8 JSON persistence and autostart
- NativeMethods.cs
- Win32 P/Invoke declarations
Contributing and future directions PeekDesktop welcomes community contributions. The current status highlights several completed items and a host of future ideas, including:
- Completed
- Clicking empty wallpaper to peek
- Clicking empty taskbar area to peek (opt-in)
- Restore on app click or taskbar click
- Restore on a second wallpaper click
- Clicking or dragging desktop icons does not start peek
- Right-click desktop icons while peeking while preserving context menus
- Desktop icons remain usable during peeking
- Exact window positions are restored
- GitHub release-based update checks
- Works with PowerToys Keyboard Manager (keyboard remapping)
- In-progress or future ideas
- Smoother minimize/restore animations (slide or fade)
- Hot-key support (for example, Ctrl+F12 to toggle peek)
- Per-monitor per-monitor peeking (minimize only on the clicked monitor)
- Exclusion rules to prevent peeking for specific apps
- Further refinements to fly-away animations and compatibility with external window managers
An emphasis on compactness and portability One of the notable goals of PeekDesktop’s architecture is to minimize its footprint. The project demonstrates that a Windows desktop utility can be implemented with minimal dependencies, using light, targeted Windows APIs and a lean codebase. The journey from a standard .NET WinForms approach to a compact, native-like experience illustrates how thoughtful engineering can yield a robust, low-resource tool that remains responsive and stable in everyday usage.
. NET Native AOT — The Size Journey PeekDesktop includes a focused narrative about how small a .NET Native AOT application can become. The project’s evolution demonstrates multiple milestones:
- v0.4.5
- Around 65 MB, a self-contained .NET-based build.
- v0.5.0
- Reduced to approximately 17.5 MB with native AOT enabled.
- v0.6.0
- Shrunk further to about 4.2 MB by dropping WinForms and moving to pure Win32 P/Invoke for tray icons, menus, and the message loop.
- v0.6.1
- Decreased to around 2.3 MB by replacing HttpClient with OS-native WinHTTP.
- v0.7.2
- Dropped JSON source generator, System.Reflection, and managed delegates to further minimize dependencies.
- v0.7.2 + LZMA
- Compressed to roughly 564 KB through LZMA compression for distribution.
- The core takeaway
- The key techniques behind the compact size include avoiding WinForms and System.Drawing, replacing HttpClient with WinHTTP, hand-writing small JSON readers/writers, avoiding System.Reflection, and using UnmanagedCallersOnly function pointers to minimize marshaling overhead.
These optimizations culminated in a nimble, portable binary with the goal of startup predictability and ease of deployment. The collaboration and optimization work by the project’s contributors, including Michal Strehovský, is highlighted as a substantial influence on the final approach.
Licensing PeekDesktop is released under the MIT license, making it accessible for personal and commercial use with minimal friction. The license text is typically included with the repository, ensuring users and developers understand rights and responsibilities around distribution and modification.
Conclusion: a practical, lightweight bridge between macOS and Windows workflows PeekDesktop stands as a pragmatic answer for Windows users who appreciate the macOS Sonoma approach to desktop management. It preserves the user’s workspace integrity—minimizing or hiding windows on demand, then restoring them precisely when needed—while offering a flexible set of options to tailor behavior to different workflows. With the combination of simple deployment options, a robust architecture, and thoughtful feature parity with macOS, PeekDesktop provides a comfortable, familiar, and productive experience for Windows desktops.
Images and visuals
- PeekDesktop demo GIF
- Visualizes the core behavior of peeking by clicking the wallpaper to reveal the desktop and restore windows afterward.
- The blog post’s flow references the visual behavior to help users understand the practical implications of the feature set.
Notes for readers
- The exact behavior can vary slightly with Windows updates, third-party shell tools, or specific gaming scenarios. The Pause While Gaming option is designed to minimize interference during full-screen gameplay, but rare edge cases may still occur depending on the software environment.
- The tool’s self-contained nature eliminates the need for a separate .NET runtime on most systems, simplifying installation and ensuring consistent behavior across supported Windows versions.
If you’re exploring a macOS-inspired desktop workflow on Windows or you simply want a seamless way to focus on the task at hand, PeekDesktop offers a thoughtful, well-engineered solution. Its combination of practical functionality, flexible activation methods, and a lightweight architectural footprint makes it a compelling addition to the Windows productivity toolkit.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/shanselman/PeekDesktop
GitHub - shanselman/PeekDesktop: PeekDesktop: macOS Sonoma-Style Desktop Reveal for Windows
PeekDesktop is a Windows utility that brings the familiar macOS Sonoma feature—clicking an empty part of the wallpaper to reveal the desktop—into Windows 10 and...
github - shanselman/peekdesktop
