[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-968":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},968,"PeekDesktop","shanselman\u002FPeekDesktop","shanselman","Click your desktop to peek at it - just like macOS Sonoma.",null,"C#",664,41,7,5,0,23,63,173,69,8.87,"MIT License",false,"main",true,[],"2026-06-12 02:00:21","# PeekDesktop 👀\n\n**Click empty desktop wallpaper (or empty taskbar area) to reveal your desktop — just like macOS Sonoma.**\n\nPeekDesktop brings macOS Sonoma's \"click wallpaper to reveal desktop\" feature to Windows 10 and 11. By default it uses Explorer's native **Show Desktop** behavior, and it also includes an optional **Fly Away** experimental style plus tray toggles for **Require Double-Click** and **Peek on Taskbar Click**. Click or drag desktop icons normally without accidentally triggering peek. When you're done, click any window, the taskbar, or the wallpaper again and everything comes right back where it was.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"img\u002Fdemo.gif\" alt=\"PeekDesktop demo showing windows minimizing when you click the wallpaper\" width=\"900\" \u002F>\n\u003C\u002Fp>\n\n## Download\n\n📥 **[Download the latest release](https:\u002F\u002Fgithub.com\u002Fshanselman\u002FPeekDesktop\u002Freleases\u002Flatest)**\n\n| File | Platform |\n|------|----------|\n| `PeekDesktop-vX.Y-win-x64.zip` | Intel\u002FAMD (most PCs) |\n| `PeekDesktop-vX.Y-win-arm64.zip` | ARM64 (Surface Pro X, Snapdragon, etc.) |\n\nNo installer needed. Download the zip, extract it, and run `PeekDesktop.exe`. Release builds are **self-contained**, so you do not need to install .NET separately. It lives in your system tray and **updates itself automatically** — when a new version is available, it downloads, verifies the code signature, and restarts in place.\n\n## Documentation\n\n- **[Engineering Deep Dive](Docs\u002FPeekDesktop-Engineering-Deep-Dive.md)** - architecture, shell internals, experiments, debugging workflow, undocumented API notes, and release tradeoffs\n- **[Auto-Updater](Docs\u002FAuto-Updater.md)** - how the in-place auto-update system works, security model, swap dance, testing\n\n## How It Works\n\n1. **Click empty desktop wallpaper or empty taskbar area** (not an icon or taskbar button) -> your desktop is revealed\n2. **Stay on the desktop** -> click or drag icons, right-click, and rearrange things while windows stay hidden\n3. **Click any app, the taskbar, or empty wallpaper again** -> all windows restore to exactly where they were\n\nThat's it. It just works.\n\n## Peek Styles\n\n- **Show Desktop (Explorer)** — the default and recommended mode. Uses Explorer's native Show Desktop behavior.\n- **Fly Away (Experimental)** — animates windows offscreen. Fun but has known quirks with external window management (Win+D, taskbar). Use for the visual flair, but know it can get confused if the shell changes window state behind its back.\n\n### Under the Hood\n\nPeekDesktop uses lightweight Windows APIs:\n\n- **`SetWindowsHookEx(WH_MOUSE_LL)`** — low-level mouse hook to detect desktop clicks\n- **`WindowFromPoint`** — identifies the window under your cursor\n- **MSAA hit-testing (`AccessibleObjectFromPoint`)** — distinguishes empty wallpaper from desktop icons\n- **UI Automation hit-testing** — classifies empty taskbar space without firing on Start, pinned apps, or tray buttons\n- **Taskbar Show Desktop button click** — primary path, immune to keyboard remapping (PowerToys, etc.)\n- **Win+D `SendInput`** — fallback if taskbar button is unavailable\n- **`EnumWindows` + `WINDOWPLACEMENT`** — captures exact position and state (including maximized) of every window\n- **`SetWinEventHook(EVENT_SYSTEM_FOREGROUND)`** — watches for when you switch back to an app\n- **`SetWindowPlacement`** — restores windows to their exact previous positions\n\nNo admin rights required. Uses \u003C 5 MB RAM idle.\n\n## System Tray\n\nRight-click the tray icon for options:\n\n- ✅ **Enabled** — toggle the peek feature on\u002Foff\n- 🔁 **Start with Windows** — launch automatically at login\n- 🖱️ **Require Double-Click** — optionally require a double-click on the desktop to trigger peek\n- 🎮 **Pause While Gaming \u002F Full-Screen** — on by default for exclusive full-screen and known gaming fullscreen apps\n- 📌 **Peek on Taskbar Click** — optionally trigger peek from empty taskbar space\n- 🪟 **Restore All Windows on App Switch** — on by default; in Explorer show desktop mode, taskbar\u002FAlt+Tab app switches restore all hidden windows behind the selected app\n- 👀 **Peek Style** — switch between Explorer and fly-away modes\n- ℹ️ **About** — version info\n- ⬇️ **Check for Updates** — download and install newer versions automatically\n- 🔄 **Auto-Check for Updates** — on by default; silently checks for updates on startup\n- ❌ **Exit** — quit PeekDesktop\n\nWhen Windows is in dark mode, the tray menu also follows the system theme when supported by the OS.\n\n## What's New\n\n- **Small Native AOT single-file builds** for both x64 and ARM64\n- **Peek on Taskbar Click** — optional trigger from empty taskbar space\n- **Dark tray menu support** — follows Windows dark mode when available\n- **Taskbar button Show Desktop** — bypasses keyboard remappers (PowerToys Keyboard Manager, etc.)\n- **Pause While Gaming \u002F Full-Screen** — avoids interference during gaming sessions\n- **Require Double-Click** — optional double-click trigger for desktop peek\n- **In-place auto-updater** — downloads, verifies Authenticode signature, swaps, and restarts automatically\n\n## macOS Sonoma vs PeekDesktop\n\n| Feature | macOS Sonoma | PeekDesktop |\n|---------|-------------|-------------|\n| Click wallpaper to peek | ✅ | ✅ |\n| Restore on app click | ✅ | ✅ |\n| Restore on second wallpaper click | ✅ | ✅ |\n| Clicking\u002Fdragging icons does not trigger peek | ✅ | ✅ |\n| Desktop icons accessible | ✅ | ✅ |\n| Exact window position restore | ✅ | ✅ |\n| System tray control | ❌ | ✅ |\n| Multi-monitor support | ✅ | ✅ |\n| Start with OS | Login Items | ✅ Registry |\n| Smooth animation | ✅ | Fly Away mode |\n\n## Build from Source\n\n**Requirements:** [.NET 10 SDK](https:\u002F\u002Fdotnet.microsoft.com\u002Fdownload\u002Fdotnet\u002F10.0)\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fshanselman\u002FPeekDesktop.git\ncd PeekDesktop\ndotnet build src\u002FPeekDesktop\u002FPeekDesktop.csproj\n```\n\n### Run it\n\n```bash\ndotnet run --project src\u002FPeekDesktop\u002FPeekDesktop.csproj\n\n# Run the P\u002FInvoke safety harness (invalid handles + stress\u002Fleak checks)\ndotnet run --project src\u002FPeekDesktop.InteropHarness\u002FPeekDesktop.InteropHarness.csproj -- 10000\n\n# Windows-friendly wrapper script\n.\\test.ps1 -Iterations 10000\n\n# Verbose mode (prints per-test timing + leak probe diagnostics)\n.\\test.ps1 -Iterations 10000 -VerboseOutput\n```\n\n### Publish a self-contained single-file exe\n\n```bash\n# For Intel\u002FAMD\ndotnet publish src\u002FPeekDesktop\u002FPeekDesktop.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true\n\n# For ARM64\ndotnet publish src\u002FPeekDesktop\u002FPeekDesktop.csproj -c Release -r win-arm64 --self-contained -p:PublishSingleFile=true\n```\n\n### Release packaging\n\nRelease builds use **.NET Native AOT** — the exe is a fully native binary with no .NET runtime dependency. Current releases ship as self-contained single-file executables for both x64 and ARM64. Earlier experiments also used [PublishAotCompressed](https:\u002F\u002Fgithub.com\u002FMichalStrehovsky\u002FPublishAotCompressed) (LZMA), but current builds favor compatibility and predictable startup behavior.\n\n## Architecture\n\n```\nsrc\u002FPeekDesktop\u002F\n├── Program.cs             # Entry point, single-instance mutex\n├── DesktopPeek.cs         # Core state machine (Idle ↔ Peeking)\n├── MouseHook.cs           # WH_MOUSE_LL global mouse hook\n├── FocusWatcher.cs        # EVENT_SYSTEM_FOREGROUND monitor\n├── WindowTracker.cs       # Enumerate, minimize, and restore windows\n├── DesktopDetector.cs     # Identify desktop windows, icons, taskbar\n├── Win32MessageLoop.cs    # Win32 message loop + TaskbarCreated recovery\n├── Win32TrayIcon.cs       # Shell_NotifyIcon wrapper\n├── Win32Menu.cs           # Win32 popup menu wrapper\n├── Win32Icon.cs           # Programmatic icon via CreateIconIndirect\n├── WinHttp.cs             # WinHTTP wrapper (replaces HttpClient)\n├── TrayIcon.cs            # Tray icon business logic + menu wiring\n├── AppUpdater.cs          # In-place auto-updater (download, verify, swap, restart)\n├── AppDiagnostics.cs      # Logging via Trace\u002FDebugView\n├── Settings.cs            # Hand-written UTF-8 JSON persistence + autostart\n└── NativeMethods.cs       # Win32 P\u002FInvoke declarations\n```\n\n## Contributing\n\nPRs welcome! Current status and next ideas:\n\n- [x] Click empty wallpaper to peek\n- [x] Click empty taskbar area to peek (opt-in)\n- [x] Restore on app click or taskbar click\n- [x] Restore on a second wallpaper click\n- [x] Clicking or dragging desktop icons does **not** start peek\n- [x] Right-click desktop icons while peeking (context menus stay open)\n- [x] Desktop icons remain usable while peeking\n- [x] Exact window positions are restored\n- [x] GitHub release-based update checks\n- [x] Works with PowerToys Keyboard Manager (keyboard remapping)\n- [ ] Smooth minimize\u002Frestore animations (slide\u002Ffade)\n- [ ] Hotkey support (e.g., `Ctrl+F12` to toggle peek)\n- [ ] Per-monitor peek (only minimize windows on the clicked monitor)\n- [ ] Exclude specific apps from being minimized\n\n## .NET Native AOT — The Size Journey 💾\n\nPeekDesktop is a showcase for how small a .NET Native AOT application can get. Starting from a standard WinForms app, we systematically eliminated every managed framework dependency until the binary was pure Win32 P\u002FInvoke — then compressed it to fit on a floppy disk.\n\n| Version | Binary Size | What Changed |\n|---------|------------|--------------|\n| v0.4.5 | ~65 MB | Self-contained .NET (no AOT) |\n| v0.5.0 | 17.5 MB | Enabled Native AOT |\n| v0.6.0 | 4.2 MB | Dropped WinForms — pure Win32 P\u002FInvoke for tray icon, menus, message loop |\n| v0.6.1 | 2.3 MB | Replaced `HttpClient` with OS-native WinHTTP (`winhttp.dll`) |\n| v0.7.2 | 1.88 MB | Eliminated JSON source generator, `System.Reflection`, `Process.Start` |\n| v0.7.2 + LZMA | **~564 KB** | **LZMA compression via [PublishAotCompressed](https:\u002F\u002Fgithub.com\u002FMichalStrehovsky\u002FPublishAotCompressed)** |\n\n**What's left in the 1.88 MB (pre-compression)?**\n- ~1.2 MB — .NET Native AOT runtime (GC, threading, exception handling, type system)\n- ~0.4 MB — `Utf8JsonReader`\u002F`Utf8JsonWriter` + async task machinery\n- ~0.2 MB — App code, P\u002FInvoke stubs, string literals\n- ~0.08 MB — PE headers and metadata\n\n**Key techniques:**\n- **No WinForms, no System.Drawing** — `Shell_NotifyIcon`, `CreatePopupMenu`, `TrackPopupMenuEx`, `MessageBoxW`, `CreateIconIndirect` via P\u002FInvoke\n- **No HttpClient** — `WinHttpOpen`\u002F`WinHttpSendRequest` uses the OS HTTP+TLS stack at zero binary cost\n- **No JSON source generator** — hand-written `Utf8JsonReader`\u002F`Utf8JsonWriter` for the two tiny JSON shapes we need\n- **No System.Reflection** — PE version resources read via `GetFileVersionInfoExW` P\u002FInvoke\n- **No managed delegates for WndProc** — `UnmanagedCallersOnly` function pointers avoid marshaling overhead\n- **`OptimizationPreference=Size`** + `InvariantGlobalization` + stripped diagnostics\n\nSpecial thanks to [Michal Strehovský](https:\u002F\u002Fgithub.com\u002FMichalStrehovsky) — the architect of .NET Native AOT — whose [PR #5](https:\u002F\u002Fgithub.com\u002Fshanselman\u002FPeekDesktop\u002Fpull\u002F5) inspired the final round of optimizations that eliminated the JSON source generator, reflection, and managed delegates. When the person who *built* the AOT compiler optimizes your app, you pay attention. 🙏\n\n## License\n\n[MIT](LICENSE)\n","PeekDesktop 是一个能够让Windows 10和11用户通过点击桌面空白区域或任务栏空白处来显示桌面的工具，类似于macOS Sonoma中的功能。其核心功能包括使用Explorer自带的“显示桌面”行为以及可选的实验性“Fly Away”动画效果，同时支持双击触发和任务栏点击触发等设置选项。该软件采用C#语言开发，利用了轻量级的Windows API如`SetWindowsHookEx`、`WindowFromPoint`等实现对鼠标事件的监听与处理，并且具备自动更新能力。适用于希望在Windows系统上获得类似macOS桌面管理体验的用户。",2,"2026-06-11 02:40:35","CREATED_QUERY"]