When playing games on niri I noticed some games don't lock your mouse cursor to your monitor.
I didn't want to use Gamescope so I stumbled upon a way to do this natively in niri without needing any tools.
This post provides a general purpose solution.