diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index ca1bcebbbd..0a57850aeb 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -2225,6 +2225,16 @@ static void paint_pipewire() #endif gamescope::ConVar cv_cursor_composite{ "cursor_composite", 1, "0 = Never composite a cursor. 1 = Composite cursor when not nested. 2 = Always composite a cursor manually" }; +bool ShouldDrawCursor() +{ + if ( cv_cursor_composite == 2 ) + return true; + + if ( cv_cursor_composite == 0 ) + return false; + + return g_bForceRelativeMouse || !GetBackend()->GetNestedHints(); +} static void paint_all(bool async) @@ -2441,10 +2451,8 @@ paint_all(bool async) global_focus.cursor->undirty(); } - bool bForceHideCursor = ( ( GetBackend()->GetNestedHints() && !bSteamCompMgrGrab ) || cv_cursor_composite == 0 ) && cv_cursor_composite != 2; - // Draw cursor if we need to - if (input && !bForceHideCursor) { + if (input && !ShouldDrawCursor()) { global_focus.cursor->paint( input, w == input ? override : nullptr, &frameInfo);