Try fix probing failed issue on some weird systems

This commit is contained in:
Yukino Song
2024-09-21 20:28:27 +08:00
parent 50087cd7c8
commit 79c9c23232
2 changed files with 13 additions and 2 deletions

View File

@@ -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