MacOS does not allow windows to be fully off-screen. If you move a window off-screen, MacOS will move the edge of the window 40 pixels back on screen. This was the initial value for the screen_margin constant. However, if you move a window so it's edge is less than 40 pixels to the edge of the screen but still on-screen, MacOS will not adjust it. This can be taken down all the way to 1 pixel, the minimum where the edge of the window is still visible on screen.
Make screen_margin a user configurable variable (in case someone wants a different value) but set the default value to 1 pixel.
MacOS does not allow windows to be fully off-screen. If you move a window off-screen, MacOS will move the edge of the window 40 pixels back on screen. This was the initial value for the screen_margin constant. However, if you move a window so it's edge is less than 40 pixels to the edge of the screen but still on-screen, MacOS will not adjust it. This can be taken down all the way to 1 pixel, the minimum where the edge of the window is still visible on screen.
Make screen_margin a user configurable variable (in case someone wants a different value) but set the default value to 1 pixel.
Tested on a Macbook Pro with MacOS 14.