Fix risk of bad initial fullscreen mode

This commit is contained in:
Lorenzooone
2024-05-24 22:01:47 +02:00
parent ad56c2814e
commit 573050b312
4 changed files with 15 additions and 6 deletions

View File

@@ -2120,11 +2120,7 @@ void WindowScreen::create_window(bool re_prepare_size) {
}
}
if(!success) {
std::vector<sf::VideoMode> modes = sf::VideoMode::getFullscreenModes();
if(modes.size() > 0)
this->curr_desk_mode = modes[0];
else
this->curr_desk_mode = sf::VideoMode::getDesktopMode();
this->curr_desk_mode = sf::VideoMode::getDesktopMode();
}
this->m_window_width = curr_desk_mode.width;
this->m_window_height = curr_desk_mode.height;