obs-studio
obs-studio copied to clipboard
mac-capture: If window is not found, look for a matching one
Description
If a macOS Screen Capture is started in windowed mode, and the target window does not exist, try to find one with a matching title and application bundle ID.
Motivation and Context
I use a window capture for speedrun splits. Prior to this change, I had to reconfigure my window capture every time I started runs, due to OBS not automatically recognizing the window. This patch matches the behavior of the deprecated macOS Window Capture source (except it still does not watch for the window to be opened if it is closed when the capture starts).
How Has This Been Tested?
I tested on my local machine, an M1 MBP running macOS 14.0. I verified it correctly finds a matching window, and falls back gracefully to the old behavior if no matching window is found. I also checked to make sure it does not break the behavior of the display capture or application capture.
Types of changes
- Tweak (non-breaking change to improve existing functionality)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.