Add Desktop Peek feature — click empty desktop/taskbar to reveal windows#743
Add Desktop Peek feature — click empty desktop/taskbar to reveal windows#743wangjiati wants to merge 5 commits into
Conversation
Port PeekDesktop (github.com/shanselman/PeekDesktop) into AltSnap: - new peek.c: low-level mouse hook detects clicks on desktop wallpaper and empty taskbar area, minimizes all visible windows on click and restores them on next click/app-switch (like macOS Sonoma) - add Peek controls to General tab: enable/disable, double-click mode, taskbar peek, gaming pause, restore-on-app-switch, peek mode selector - add configuration support (optlst/strlst/combo) in config.c - add 8 control IDs in resource.h and expand dialog layout to fit - unify all 6 property-sheet pages to 275px height with consistent container margins, expand dialog width to 260 DLU - add complete Peek translations for all 19 supported languages - document the feature in README (EN/ZH/KO) - add .gitignore to exclude .claude/, build/, tests/ Bugs fixed along the way: - IsFullscreenApp false-positive with system windows (TextInputHost etc.) - IsTaskbarBlank now walks parent chain + uses MonitorFromPoint fallback - PeekHandleMouseEvent no longer blocks mouse-up from propagating - double-click detection state preserved across click pairs - About-tab crash (duplicate control IDs in window.rc, NULL langinfo) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The ZIP package was missing AltSnap.dni (the default config template). Without it, new portable users would start with no configuration at all. The NSIS installer already included it; this aligns the ZIP with the installer. Also replaced the pre-configured AltSnap.ini with the template .dni so that the portable package uses the same documented defaults. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Excuse me to say that, I do reckon you did a lot of work, but I have a lot of problems with your PR.
Also why is PEEK_LVM_HITTEST defined to 0x1009? if it is an actual alias for LVM_HITTEST it should be (LVM_FIRST+18) which is 0x1012. Were did you find this information? This is all crazy to me, especially considering it seems you are not using the function anywhere anyway. Anyway connecting to a remote process and querying a list view which is not guarantee to be there in the future is a no-go.
You did a lot of work indeed. However, if you want the feature, why not just use PeekDesktop? |
Match the original release format: use AltSnap.ini (portable config) instead of AltSnap.dni (template), and include the Themes/ directory. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
I'm not sure what this application's policy is on vibe-coded features, but I'd personally be hesitant with how much of this PR (seemingly all of it) appears to be AI generated. Just looking at the .gitignore changes, it looks like it's totally centered around Claude. |
A quick note before we startI want to be upfront: I used Claude (Anthropic's AI coding assistant) to help port the PeekDesktop logic to C, organize commits, and write the PR. I did all the manual testing on real hardware myself. The bugs you spotted — dead code, class name filters, wrong LVM_HITTEST value — those are on me, I should have reviewed the AI output more carefully. Also, Chinese is my native language and this reply was written with translation help, so please excuse any phrasing that sounds unnatural. Thanks so much for the thorough review — I really appreciate you taking the time to go through the code carefully. Rationale for integrationI deploy AltSnap on industrial PCs where operators have minimal computer skills. There are two concrete problems that integration solves:
I understand this may not be a feature you want to carry in the mainline, and I'll respect your decision either way. Bugs and code issues — fixedIsDesktopIcon() — removedYou're absolutely right about the cross-process memory access. This was dead code — I removed the call during testing (the icon check made peek unusable on icon-dense desktops) but forgot to clean up the function. Removed:
PEEK_LVM_HITTEST valuePorting error from the C# source — you're correct. Since UWP class name filters — removed
WinEvent hook — kept with explanationI've kept the Summary of changes (latest commit)
Let me know if there are other issues you'd like me to address. Thanks again for the careful review. |
|
I am personally bias against IA, but I would prefer to be more neutral in this regard. It is always difficult to say no to people that are trying their best to have a meaningful contribution. My plan is to maintain a program that people enjoy using. It seems a lot of lines of code for basically just a "minimize / restore all windows". Also I want to stay a little humble, I have proven myself clueless recently. #723. |
|
I did not review deeply yet, I was just quickly looking into the code. So the rationale for having this inside AltSnap is only to have the feature + AltSnap with a single process. How often does one of the process crashes and has to be restarted? How hard can it be to install both of them given they are both available on winget? Also PeekDesktop is written in C# which is a managed Language an has more protections against crashes than a plain C, where a small mistake in the code can lead to catastrophic failure. Of course this may not be very relevant for this specific application where you have to call a lot of raw Win32 API. I will for now keep this PR opened and I will wait to see if it can be more simply implemented in the future when maybe I will have other uses for a global event hook in the program. |
Summary
Port PeekDesktop (by Scott Hanselman, MIT License) into AltSnap.
Click on empty desktop wallpaper (or empty taskbar area) to reveal your desktop — just like macOS Sonoma. All visible windows minimize with a single click; click again or switch to any application to restore them.
Changes
New features
Bug fixes
Maintenance
Test plan