Skip to content

Commit

Permalink
steamcompmgr: Fix some crashes with global focus
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Mar 1, 2025
1 parent cc15bf6 commit 8ff4930
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,14 @@ bool ShouldDrawCursor()
if ( cv_cursor_composite == 0 )
return false;

return g_bForceRelativeMouse || !GetCurrentFocus()->GetNestedHints();
if ( g_bForceRelativeMouse )
return true;

global_focus_t *pFocus = GetCurrentFocus();
if ( !pFocus )
return false;

return !pFocus->GetNestedHints();
}

static void
Expand Down Expand Up @@ -8363,7 +8370,11 @@ struct wlserver_x11_surface_info *lookup_x11_surface_info_from_xid( gamescope_xw

MouseCursor *steamcompmgr_get_current_cursor()
{
return GetCurrentFocus()->cursor;
global_focus_t *pFocus = GetCurrentFocus();
if ( !pFocus )
return nullptr;

return pFocus->cursor;
}

MouseCursor *steamcompmgr_get_server_cursor(uint32_t idx)
Expand Down

0 comments on commit 8ff4930

Please sign in to comment.