NoGUI: Use current resolution if unspecified
This commit is contained in:
@@ -29,6 +29,10 @@ if(USE_EVDEV)
|
||||
target_link_libraries(duckstation-nogui PRIVATE ${LIBEVDEV_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(USE_DRMKMS)
|
||||
target_compile_definitions(duckstation-nogui PRIVATE "-DWITH_DRMKMS=1")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_sources(duckstation-nogui PRIVATE
|
||||
duckstation-nogui.manifest
|
||||
|
||||
@@ -125,6 +125,7 @@ bool NoGUIHostInterface::CreateDisplay()
|
||||
if (!CreateHostDisplayResources())
|
||||
Log_WarningPrint("Failed to create host display resources");
|
||||
|
||||
Log_InfoPrintf("Host display initialized at %ux%u resolution", m_display->GetWindowWidth(), m_display->GetWindowHeight());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user