Skip to content

Commit

Permalink
Try fix probing failed issue on some weird systems
Browse files Browse the repository at this point in the history
  • Loading branch information
ClassicOldSong committed Sep 21, 2024
1 parent 50087cd commit 79c9c23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/platform/windows/display_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,13 @@ namespace platf::dxgi {

// Try probing with different GPU preferences and verify_frame_capture flag
if (validate_and_test_gpu_preference(display_name, true)) {
set_gpu_preference = true;
return true;
}

// If no valid configuration was found, try again with verify_frame_capture == false
if (validate_and_test_gpu_preference(display_name, false)) {
set_gpu_preference = true;
return true;
}

Expand Down
13 changes: 11 additions & 2 deletions src/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,23 @@ namespace proc {
// Set primary display if needed
if (shouldActuallySetPrimary) {
auto disp = shouldSetVDisplayPrimary ? vdisplayName : prevPrimaryDisplayName;
BOOST_LOG(info) << "Setting display " << disp << " primary!!!";
BOOST_LOG(info) << "Setting display " << disp << " primary";

VDISPLAY::setPrimaryDisplay(disp.c_str());
if (!VDISPLAY::setPrimaryDisplay(disp.c_str())) {
BOOST_LOG(info) << "Setting display " << disp << " primary failed! Are you using Windows 11 24H2?";
}
}

// Set virtual_display to true when everything went fine
this->virtual_display = true;
this->display_name = platf::to_utf8(vdisplayName);

if (config::video.headless_mode) {
// When using headless mode, we don't care which display user configured to use.
// So we always set output_name to the newly created virtual display as a workaround for
// empty name when probing graphics cards.
config::video.output_name = this->display_name;
}
}
}
#endif
Expand Down

0 comments on commit 79c9c23

Please sign in to comment.