Skip to content

Commit

Permalink
WaylandBackend: handle unfocused refresh
Browse files Browse the repository at this point in the history
When handling presentation feedback, if libdecor states that the window
is inactive, then use the unfocused value. Otherwise, handle the
feedback as normal.
  • Loading branch information
MithicSpirit committed Dec 22, 2024
1 parent 1c9495c commit 01101ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Backends/WaylandBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,9 @@ namespace gamescope
uint64_t ulTime = ( ( ( uint64_t( uTVSecHi ) << 32ul ) | uTVSecLo ) * 1'000'000'000lu ) +
( uint64_t( uTVNSec ) );

if ( uRefreshCycle )
if ( ! (m_eWindowState & LIBDECOR_WINDOW_STATE_ACTIVE) && g_nNestedUnfocusedRefresh > 0)
g_nOutputRefresh = g_nNestedUnfocusedRefresh;
else if ( uRefreshCycle )
{
int32_t nRefresh = RefreshCycleTomHz( uRefreshCycle );
if ( nRefresh && nRefresh != g_nOutputRefresh )
Expand Down

0 comments on commit 01101ee

Please sign in to comment.