donotturnoff / aerend

My third year project
0 stars 0 forks source link

Prevent windows leaving the screen #97

Closed donotturnoff closed 2 years ago

donotturnoff commented 2 years ago

When a window is dragged, its position is updated by adding on the cursor displacement, but this happens before the cursor is constrained to the screen and so the window may end up being thrown off the screen and then being inaccessible.

I could fix this by, instead of taking the raw cursor_dx and cursor_dy in MergedUpdates, recomputing the dx and dy as the difference of the new cursor_x and the old cursor_x, etc.