Skip to content

Commit

Permalink
steamcompmgr: Add some logic for picking commits if we have an overri…
Browse files Browse the repository at this point in the history
…de w/ WSI layer
  • Loading branch information
misyltoad committed Sep 11, 2024
1 parent 6f516c3 commit 52981b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6360,9 +6360,22 @@ void update_wayland_res(CommitDoneList_t *doneCommits, steamcompmgr_win_t *w, Re
return;
}

// If we have an override surface, make sure this commit is for the current surface.
// If we ever use HDR on the surface, only ever accept flip commits from the WSI layer.
if ( reslistentry.feedback && reslistentry.feedback->vk_colorspace != VK_COLOR_SPACE_SRGB_NONLINEAR_KHR )
{
w->bHasHadNonSRGBColorSpace = true;
}

// If there are random commits that are really thin/small when we have the WSI layer active ever,
// let's just ignore these as they are probably bogus commits from glamor.
bool bPossiblyBogus = reslistentry.buf->width <= 2 || reslistentry.buf->height <= 2;

// If we have an override surface, make sure this commit is for the current surface
// or if the commit is probably bogus.
bool bOnlyCurrentSurface = w->bHasHadNonSRGBColorSpace || bPossiblyBogus;

bool for_current_surface = !w->override_surface() || w->current_surface() == reslistentry.surf;
if (!for_current_surface)
if ( bOnlyCurrentSurface && !for_current_surface )
{
wlserver_lock();
wlr_buffer_unlock( buf );
Expand Down
2 changes: 2 additions & 0 deletions src/steamcompmgr_shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ struct steamcompmgr_win_t {
bool hasHwndStyleEx = false;
uint32_t hwndStyleEx = 0;

bool bHasHadNonSRGBColorSpace = false;

bool nudged = false;
bool ignoreOverrideRedirect = false;

Expand Down

0 comments on commit 52981b8

Please sign in to comment.