From 00133d8cf3a75906c447d171f10854261c37314c Mon Sep 17 00:00:00 2001 From: Hans Gaiser Date: Thu, 27 Nov 2025 23:18:35 +0100 Subject: [PATCH 1/2] Draw cursor in pipewire stream. --- src/steamcompmgr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index fe061acfa3..be9ed90912 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -2382,6 +2382,15 @@ static void paint_pipewire() if ( pFocus->overrideWindow && !pFocus->focusWindow->isSteamStreamingClient ) paint_window( pFocus->overrideWindow, pFocus->focusWindow, &frameInfo, nullptr, PaintWindowFlag::NoFilter, 1.0f, pFocus->overrideWindow ); + if ( ShouldDrawCursor() ) + { + MouseCursor *cursor = steamcompmgr_get_current_cursor(); + if ( cursor ) + { + cursor->paint( pFocus->focusWindow, pFocus->focusWindow, &frameInfo ); + } + } + gamescope::Rc pRGBTexture = s_pPipewireBuffer->texture->isYcbcr() ? vulkan_acquire_screenshot_texture( uWidth, uHeight, false, DRM_FORMAT_XRGB2101010 ) : gamescope::Rc{ s_pPipewireBuffer->texture }; From 85041b252f3f074e4a38dfd9b2545c524a180cae Mon Sep 17 00:00:00 2001 From: Hans Gaiser Date: Fri, 28 Nov 2025 07:50:50 +0100 Subject: [PATCH 2/2] Redraw pipewire frame when cursor changes. --- src/steamcompmgr.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index be9ed90912..4b195ef129 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -2358,12 +2358,32 @@ static void paint_pipewire() uint64_t ulFocusCommitId = window_last_done_commit_id( pFocus->focusWindow ); uint64_t ulOverrideCommitId = window_last_done_commit_id( pFocus->overrideWindow ); + bool bDrawCursor = ShouldDrawCursor(); + MouseCursor *cursor = steamcompmgr_get_current_cursor(); + int nCursorX = cursor ? cursor->x() : 0; + int nCursorY = cursor ? cursor->y() : 0; + + static int s_nLastCursorX = 0; + static int s_nLastCursorY = 0; + static bool s_bLastDrawCursor = false; + + bool bCursorChanged = bDrawCursor != s_bLastDrawCursor; + if ( bDrawCursor ) + { + if ( nCursorX != s_nLastCursorX || nCursorY != s_nLastCursorY ) + bCursorChanged = true; + } + if ( ulFocusCommitId == s_ulLastFocusCommitId && - ulOverrideCommitId == s_ulLastOverrideCommitId ) + ulOverrideCommitId == s_ulLastOverrideCommitId && + !bCursorChanged ) return; s_ulLastFocusCommitId = ulFocusCommitId; s_ulLastOverrideCommitId = ulOverrideCommitId; + s_nLastCursorX = nCursorX; + s_nLastCursorY = nCursorY; + s_bLastDrawCursor = bDrawCursor; uint32_t uWidth = s_pPipewireBuffer->texture->width(); uint32_t uHeight = s_pPipewireBuffer->texture->height();