NoGUI: Use current resolution if unspecified

This commit is contained in:
Connor McLaughlin
2021-04-08 03:02:24 +10:00
parent 830612dbbf
commit 32ac60414c
5 changed files with 125 additions and 1 deletions

View File

@@ -10,6 +10,10 @@
#include <unistd.h>
Log_SetChannel(VTYHostInterface);
#ifdef WITH_DRMKMS
#include "common/drm_display.h"
#endif
VTYHostInterface::VTYHostInterface() = default;
VTYHostInterface::~VTYHostInterface()
@@ -88,6 +92,15 @@ std::optional<WindowInfo> VTYHostInterface::GetPlatformWindowInfo()
}
}
#ifdef WITH_DRMKMS
// set to current mode
if (wi.surface_width == 0)
{
if (!DRMDisplay::GetCurrentMode(&wi.surface_width, &wi.surface_height, &wi.surface_refresh_rate))
Log_ErrorPrintf("Failed to get current mode, will use default.");
}
#endif
return wi;
}