Skip to content

Feature/multi window capture 6354641966890463151#32

Open
Cautioncrazy wants to merge 9 commits into
collingreen:masterfrom
Cautioncrazy:feature/multi-window-capture-6354641966890463151
Open

Feature/multi window capture 6354641966890463151#32
Cautioncrazy wants to merge 9 commits into
collingreen:masterfrom
Cautioncrazy:feature/multi-window-capture-6354641966890463151

Conversation

@Cautioncrazy
Copy link
Copy Markdown

No description provided.

google-labs-jules Bot and others added 9 commits April 20, 2026 20:30
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>
@collingreen
Copy link
Copy Markdown
Owner

hi! thanks for a PR - I'll have a look

Copy link
Copy Markdown
Owner

@collingreen collingreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread chronolapse.py
self.menu.FindItemById(self.wx_id).SetText("Restore")
else:
self.menu.FindItemById(self.wx_id).SetText("Minimize")
if hasattr(self, 'menu') and self.menu:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does menu no longer exist? why is this change needed?

Comment thread test_enum.py
@@ -0,0 +1,24 @@
import sys
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this file should become part of the codebase

Comment thread AGENTS.md
@@ -0,0 +1,31 @@
# Chronolapse Multi-Window Capture Architecture
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread chronolapse.py
'screenshot_subsection_width': '800',
'screenshot_subsection_height': '600',

'target_windows': 'Jules, GitHub Desktop, RPG Maker',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be in the default config

Comment thread chronolapse.py
def exitMenuClicked(self, event): # wxGlade: chronoFrame.<event_handler>
self.Close()

def onRefreshWindowsPressed(self, event):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this fails silently on unsupported platforms or if something is configured incorrectly.

Comment thread chronolapse.py

def saveTargetWindows(self, filename, target_windows):
if not has_win32gui:
return self.saveScreenshot(filename)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a silent fallback to behavior the user isnt actually expecting which seems confusing and frustrating

@Cautioncrazy
Copy link
Copy Markdown
Author

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.
I'll leave this up for those who would like to use it as a starting point but it is for a very specific use case with settings/Configs that are specific to my project and OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants