Prevent mouse from going beyond monitor bounds when gaming

Found another fix, posting here if anyone runs into this problem again:
I ran into the same issue with Stalker 2, but gamescope wouldn’t work with it, but I stumbled upon this post talking about how ProtonGE could fix it: Reddit - The heart of the internet
So I downloaded the latest ProtonGE using proton plus, set Stalker 2 to launch with it in compatibility options, and added PROTON_ENABLE_WAYLAND=1 %command% to launch options.
From my understanding, this issue can happen when using XWayland, so forcing native wayland fixes it, in Stalker 2 at least, haven’t tested with other games yet.