Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/Backends/SDLBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ namespace gamescope
SDL_Window *m_pWindow = nullptr;
VkSurfaceKHR m_pVkSurface = VK_NULL_HANDLE;
BackendConnectorHDRInfo m_HDRInfo{};
mutable BackendMode m_NativeMode{};
};

class CSDLBackend : public CBaseBackend
Expand Down Expand Up @@ -277,7 +278,8 @@ namespace gamescope

GamescopeScreenType CSDLConnector::GetScreenType() const
{
return gamescope::GAMESCOPE_SCREEN_TYPE_INTERNAL;
// Steam only sizes itself from an external mode list.
return gamescope::GAMESCOPE_SCREEN_TYPE_EXTERNAL;
}
GamescopePanelOrientation CSDLConnector::GetCurrentOrientation() const
{
Expand All @@ -302,7 +304,13 @@ namespace gamescope
}
std::span<const BackendMode> CSDLConnector::GetModes() const
{
return std::span<const BackendMode>{};
m_NativeMode = BackendMode
{
.uWidth = g_nOutputWidth,
.uHeight = g_nOutputHeight,
.uRefresh = uint32_t( ConvertmHzToHz( g_nOutputRefresh ) ),
};
return std::span<const BackendMode>{ &m_NativeMode, 1 };
}

bool CSDLConnector::SupportsVRR() const
Expand Down Expand Up @@ -478,7 +486,7 @@ namespace gamescope
}
IBackendConnector *CSDLBackend::GetConnector( GamescopeScreenType eScreenType )
{
if ( eScreenType == GAMESCOPE_SCREEN_TYPE_INTERNAL )
if ( eScreenType == GAMESCOPE_SCREEN_TYPE_EXTERNAL )
return &m_Connector;

return nullptr;
Expand Down
14 changes: 11 additions & 3 deletions src/Backends/WaylandBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ namespace gamescope
uint32_t m_uMaxTargetLuminance = 203;
displaycolorimetry_t m_DisplayColorimetry = displaycolorimetry_709;
std::vector<uint8_t> m_FakeEdid;
mutable BackendMode m_NativeMode{};

CWaylandBackend *m_pBackend = nullptr;

Expand Down Expand Up @@ -1197,7 +1198,8 @@ namespace gamescope

GamescopeScreenType CWaylandConnector::GetScreenType() const
{
return gamescope::GAMESCOPE_SCREEN_TYPE_INTERNAL;
// Steam only sizes itself from an external mode list.
return gamescope::GAMESCOPE_SCREEN_TYPE_EXTERNAL;
}
GamescopePanelOrientation CWaylandConnector::GetCurrentOrientation() const
{
Expand All @@ -1222,7 +1224,13 @@ namespace gamescope
}
std::span<const BackendMode> CWaylandConnector::GetModes() const
{
return std::span<const BackendMode>{};
m_NativeMode = BackendMode
{
.uWidth = g_nOutputWidth,
.uHeight = g_nOutputHeight,
.uRefresh = uint32_t( ConvertmHzToHz( g_nOutputRefresh ) ),
};
return std::span<const BackendMode>{ &m_NativeMode, 1 };
}

bool CWaylandConnector::SupportsVRR() const
Expand Down Expand Up @@ -2331,7 +2339,7 @@ namespace gamescope
}
IBackendConnector *CWaylandBackend::GetConnector( GamescopeScreenType eScreenType )
{
if ( eScreenType == GAMESCOPE_SCREEN_TYPE_INTERNAL )
if ( eScreenType == GAMESCOPE_SCREEN_TYPE_EXTERNAL )
return GetCurrentConnector();

return nullptr;
Expand Down
4 changes: 4 additions & 0 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10477,6 +10477,10 @@ steamcompmgr_main(int argc, char **argv)
wlserver_unlock();
}

// A nested output resizes with its window, so its mode list follows.
if ( currentOutputWidth != g_nOutputWidth || currentOutputHeight != g_nOutputHeight )
update_mode_atoms( root_ctx, &flush_root );

// XXX(JoshA): Remake this. It sucks.
if ( GetBackend()->UsesVulkanSwapchain() )
{
Expand Down
Loading