Feature/multi window capture 6354641966890463151#32
Conversation
Implemented Phase 1 of the multi-window targeting system for Windows. Added `target_windows` configuration, and modified the core capture loop to dynamically fetch coordinates via win32gui and capture using mss. Outputs as parallel image sequences appending window names. Added AGENTS.md documenting architecture. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Implemented Phase 1 of the multi-window targeting system for Windows. Added `target_windows` configuration, and modified the core capture loop to dynamically fetch coordinates via win32gui and capture using mss. Outputs as parallel image sequences appending window names. Added AGENTS.md documenting architecture. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Implemented Phase 2 GUI integration for multi-window capture using wxPython CheckListBox. Added DPI awareness and DwmGetWindowAttribute to fix physical bounding box issues on modern Windows versions. Updated AGENTS.md status. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Moved the initialization of the ON_WINDOWS variable to occur before the SetProcessDPIAware check that relies on it. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
- Extracted `import ctypes` outside the `win32gui` try-except block so that it correctly imports before being used for DPI awareness checks on all Windows platforms. - Increased `grid_sizer_1` row count from 4 to 5 to accommodate the new multi-window layout container, preventing the `wxAssertionError` crash during app initialization. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Added a `has_win32gui` global flag that gets set to True only if the import succeeds. The `onRefreshWindowsPressed` event and `saveTargetWindows` loop now check this flag, safely returning early or falling back to regular screenshotting on systems without pywin32 installed. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Changed wx.CheckListBox update logic to use `.Clear()` and `.AppendItems()` instead of `.Set()` to ensure it draws properly across wx versions. Added explicit exception logging for `win32gui` import failures to help diagnose silent skipping. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Updated AGENTS.md to explicitly state that `pywin32` is the required pip package to use `win32gui`, preventing users from accidentally downloading broken placeholder packages on PyPI. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
Replaced `mss` with `win32gui.PrintWindow` and `win32ui` to allow capturing target windows even when obscured or out of focus. Fixed a `NoneType` crash when minimizing the app to the taskbar by validating the menu item exists before attempting to set its text. Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
|
hi! thanks for a PR - I'll have a look |
collingreen
left a comment
There was a problem hiding this comment.
thanks for the PR demonstrating some new windows functionality using mss
if you want this to get merged there are some things to clean up and some ux to improve, especially around handling things going wrong. also would like to see either multi-platform implementation or not showing invalid UI to platforms that don't support it
alternatively you can just leave this PR here as an example for others to cherry pick from if they want to implement their own similar functionality for their specific use case
| self.menu.FindItemById(self.wx_id).SetText("Restore") | ||
| else: | ||
| self.menu.FindItemById(self.wx_id).SetText("Minimize") | ||
| if hasattr(self, 'menu') and self.menu: |
There was a problem hiding this comment.
does menu no longer exist? why is this change needed?
| @@ -0,0 +1,24 @@ | |||
| import sys | |||
There was a problem hiding this comment.
I dont think this file should become part of the codebase
| @@ -0,0 +1,31 @@ | |||
| # Chronolapse Multi-Window Capture Architecture | |||
There was a problem hiding this comment.
I dont think this file should become part of the codebase
ALSO this is a plan for a very specific feature not general advice for agents.
| 'screenshot_subsection_width': '800', | ||
| 'screenshot_subsection_height': '600', | ||
|
|
||
| 'target_windows': 'Jules, GitHub Desktop, RPG Maker', |
There was a problem hiding this comment.
this shouldn't be in the default config
| def exitMenuClicked(self, event): # wxGlade: chronoFrame.<event_handler> | ||
| self.Close() | ||
|
|
||
| def onRefreshWindowsPressed(self, event): |
There was a problem hiding this comment.
looks like this fails silently on unsupported platforms or if something is configured incorrectly.
|
|
||
| def saveTargetWindows(self, filename, target_windows): | ||
| if not has_win32gui: | ||
| return self.saveScreenshot(filename) |
There was a problem hiding this comment.
this is a silent fallback to behavior the user isnt actually expecting which seems confusing and frustrating
|
This was actually not meant to be pushed to the main branch but I didn't realize I was still on your main branch and not my main fork. |
No description provided.