I'm using a dual-screen setup and some games seem to not lock the mouse to the screen, especially in Battlefield 2142 a while ago I often left the game with my cursor, which was bad when I tried to turn around quickly to shoot someone, suddenly I was back in Windows and quite dead in the game because I clicked on the Windows desktop or another window on the second screen which caused BF2142 to minimize.
The last game I played a few days ago that had this problem was Stubbs the Zombie (of which I heard here on GSE) which didn't even try to keep the mouse on the screen, I couldn't turn right much or my mouse ended up on the second screen minimizing the game when I clicked at the wrong moment.
I remember a few other games where I had this problem a little longer in the past, so is there a solution to this problem without forcing me to disable the second monitor?