Skip to content

win-capture: Skip disconnected display devices - #13788

Open
prgmitchell wants to merge 1 commit into
obsproject:masterfrom
prgmitchell:fixDisconnectedMonitors
Open

prgmitchell wants to merge 1 commit into
obsproject:masterfrom
prgmitchell:fixDisconnectedMonitors

Conversation

@prgmitchell

@prgmitchell prgmitchell commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Description

Use DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag to select the attached display instead of assuming index 0 is active. When researching this issue I saw this flag mentioned in the Microsoft docs

To select all display devices in the desktop, use only the display devices that have the DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag in the DISPLAY_DEVICE structure.

Just as a note I wasn't sure whether to use LPCSTR or const char in the helper so I just followed the Microsoft docs, open to changing if this makes a difference as my C knowledge is on a "learn as you go" basis.

Motivation and Context

Not sure if there were other Github issues that I am not seeing, but #8040 described this issue and was closed although the issue remains.

How Has This Been Tested?

Ran a build of OBS before these changes with one of my 3 displays disconnected, the remaining two both displayed the same display when selected in a display capture source. Performed the same test with these changes, the two displays now showed correctly.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Use DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag to select the attached
display instead of assuming index 0 is active.
@Fenrirthviti

Fenrirthviti commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Related issue: #12273

May fix: #8181

@z500

z500 commented Aug 25, 2026 •

Copy link
Copy Markdown

Thank you for your contribution. I am having a similar issue as depicted in #8181 and #12273. I have three monitors, when disconnecting Monitor 3 in Windows Display settings, changing the monitor in Display Capture dropdown only displays one of the remaining two monitors, regardless of selection. If I select Monitor 1, monitor 2 shows up. If I select Monitor 2, monitor 2 shows up. With Monitor 1 not being shown at all.
Prior to testing:
OS Name Microsoft Windows 11 Pro
Version 10.0.26200 Build 26200
OBS Version: 32.2.2

I tested your changes and the issue is fixed. Now, the correct monitor shows up when the third monitor is disconnected virtually via Windows Display settings. Now the expected behavior is happening, selecting Monitor 1 shows Monitor 1 and selecting Monitor 2 shows Monitor 2.
During testing:
OS Name Microsoft Windows 11 Pro
Version 10.0.26200 Build 26200
OBS Version: 32.2.1-11-g019047d70

@github-project-automation github-project-automation Bot moved this to Ready For Review in 33.1 Release Tracker Aug 25, 2026
@WizardCM WizardCM added kind/bug Categorizes issue or PR as related to a bug. platform/windows Categorizes issue or PR as affecting Windows specifically labels Sep 13, 2026
@Aaron1017

Copy link
Copy Markdown

Having a problem in OBS 32.2.2 where it won't capture the correct display. Display 3 is disconnected in Windows setting, but still physically plugged in. Trying to capture display 2 and use display 1 for stream management.
OBS refuses to capture display 2 and always default to display 1 when selecting the source from the drop down menu.

Tested these changes and my issue is fixed. The correct monitor shows up when the 3rd monitor (TV via HDMI) is disconnected via Windows Display settings. Now the expected behavior is happening, selecting Monitor 1 shows Monitor 1 and selecting Monitor 2 shows Monitor 2.

This branch has not been deployed

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

Labels

kind/bug Categorizes issue or PR as related to a bug. platform/windows Categorizes issue or PR as affecting Windows specifically Seeking Testers Build artifacts on CI

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

5 participants