Skip to content

Commit

Permalink
steamcompmgr: Fix race when sending refresh cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Oct 25, 2023
1 parent 8cee4f2 commit 5916bb2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6221,18 +6221,21 @@ void handle_presented_for_window( steamcompmgr_win_t* w )
if (struct wlr_surface *surface = w->current_surface())
{
auto info = get_wl_surface_info(surface);
if (info->gamescope_swapchain != nullptr)
if (info->gamescope_swapchain != nullptr && info->last_refresh_cycle != refresh_cycle)
{
// Could have got the override set in this bubble.s
surface = w->current_surface();

if (info->last_refresh_cycle != refresh_cycle)
wlserver_lock();
if (info->gamescope_swapchain != nullptr)
{
wlserver_lock();
info->last_refresh_cycle = refresh_cycle;
wlserver_refresh_cycle(surface, refresh_cycle);
wlserver_unlock();
// Could have got the override set in this bubble.s
surface = w->current_surface();

if (info->last_refresh_cycle != refresh_cycle)
{
info->last_refresh_cycle = refresh_cycle;
wlserver_refresh_cycle(surface, refresh_cycle);
}
}
wlserver_unlock();
}
}
}
Expand Down

0 comments on commit 5916bb2

Please sign in to comment.