-
Notifications
You must be signed in to change notification settings - Fork 166
Fixes bug #2729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fixes bug #2729
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in the Win+D per monitor functionality by replacing PostMessage with ShowWindow API calls for better compatibility with applications that have popup windows, specifically addressing issues with Excel.
- Changed window minimization/restoration from
PostMessage(WM_SYSCOMMAND, SC_MINIMIZE/SC_RESTORE)toShowWindow(SW_MINIMIZE/SW_SHOWNOACTIVATE) - Updated version number and changelog documentation
- Added VSCode IDE configuration files (with environment-specific settings that should be reviewed)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| mods/win-d-per-monitor.wh.cpp | Core bug fix: replaced PostMessage with ShowWindow API for window control; added debug logging; updated version and changelog |
| .vscode/settings.json | Added C/C++ Runner configuration with hardcoded local paths |
| .vscode/launch.json | Added debug configuration with hardcoded local paths |
| .vscode/c_cpp_properties.json | Added IntelliSense configuration for Windows GCC |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log("ShowOwnedPopups 0x{:x} false", (uintptr_t)rc.ownerWnd); | ||
| } |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These debugging log statements appear to have been added during development and should be removed or reduced in verbosity for production code. They add excessive logging noise for normal operations.
| log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd); | ||
|
|
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This debugging log statement should be removed for production code. It adds unnecessary logging verbosity for normal operations.
| log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd); |
| "C_Cpp_Runner.debuggerPath": "gdb", | ||
| "C_Cpp_Runner.cStandard": "", | ||
| "C_Cpp_Runner.cppStandard": "", | ||
| "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hardcoded path "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat" appears to be specific to your local development environment and should not be committed to the repository. The path contains what looks like a placeholder or version number "VR_NR" that won't exist on other developers' machines. Consider adding .vscode/ to .gitignore or use workspace-relative paths instead.
| "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", |
| "cwd": "e:/eProject/windhawk-mods/mods", | ||
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hardcoded absolute path "e:/eProject/windhawk-mods/mods" is specific to your local development environment and should not be committed to the repository. This will not work for other developers who clone the repository. Consider adding .vscode/ to .gitignore or use workspace-relative paths like ${workspaceFolder} instead.
| "cwd": "e:/eProject/windhawk-mods/mods", | |
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", | |
| "cwd": "${workspaceFolder}", | |
| "program": "${workspaceFolder}/build/Debug/outDebug", |
| "stopAtEntry": false, | ||
| "externalConsole": true, | ||
| "cwd": "e:/eProject/windhawk-mods/mods", | ||
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hardcoded absolute path "e:/eProject/windhawk-mods/mods/build/Debug/outDebug" is specific to your local development environment and should not be committed to the repository. This will not work for other developers who clone the repository. Consider adding .vscode/ to .gitignore or use workspace-relative paths like ${workspaceFolder} instead.
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", | |
| "program": "${workspaceFolder}/build/Debug/outDebug", |
| // 输出窗口信息 | ||
| log("Processing window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", | ||
| wndClass, windowTitle, width, height, (uintptr_t)hWndCcc, (uintptr_t)ownerWnd); | ||
| log("Processing2 window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in log message: "Processing2" should be "Processing".
| log("Processing2 window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, | |
| log("Processing window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, |
| log("Processing2 window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, | ||
| (uintptr_t)hWndCcc, (uintptr_t)ownerWnd); | ||
|
|
||
| log("hWnd:0x{:x}", (uintptr_t)hWndCcc); |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a debugging log statement that was added during development and should likely be removed before merging to production. It duplicates information already logged in the "Processing" log statement above and doesn't add meaningful value.
| log("hWnd:0x{:x}", (uintptr_t)hWndCcc); |
2025-11-23 (v1.1.20251123)
Fixes: