your code have an error with the mouse pointer
grab in any canvas, go outside the window and release the mouse botton.
after that back to your window and push in the other canvas.
grab in any canvas, go outside the window and release the mouse botton.
after that back to your window and push in the other canvas.