Multiple monitors
I have this monitor configuration:
Application is started on (1).
- When I run the cat to the right edge of (1): it appears at the right edge of (3). And now it's impossible to run the cat back to the main monitor.
- When I run the cat to the left edge of (1): nothing happens (the cat can't pass the left edge of (1)).
As it stands, the cat is designed to remain on the screen it starts on and not be able to move between screens. An improvement is for the user to specify the layout of screens so we can move between screens. But it takes work. The cat is a transparent window. I don't think the code can move the window between screens, but maybe we can destroy the window on one screen and recreate it on the next when we reach the edge of the screen.
@crgimenes, I didn't work with GUI enough and didn't create GUI apps on linux and MacOS but I know that on Windows system windows don't belong to concrete screen 'cause they are placed on a single coordinate plane. Technically maybe it's able to move cat's window in global coordinates to another screen's position.
I have two monitors and usually I work on both. Cat frequently stacks on the screen's edge or falls through the edge to opposite side of another monitor. I would be happy if you fix this such behaviour.
Unfortunately, I don't have Windows machines, my Linux machines don't have a graphical environment, and even my Mac has only one screen. It's difficult for me to reproduce these problems.
I can confirm what @soucelover said about how window coordinates work in Windows.
Also I just checked using another utility (ShareX) and:
- X coordinates on (2) range from -1920 to 0
- X coordinates on (1) range from 1 to 1919
- X coordinates on (3) range from 1920 to 3839
All my monitors have 1920x1080 resolution.
Let me know if/how I can help!
You guys can comment on these two lines and see if that corrects the behavior on Windows. This could mess up the coordinate system; I never thought of it using negative numbers, so I might need to rewrite the direction system.
https://github.com/crgimenes/neko/blob/master/main.go#L89
m.x = max(0, min(m.x, monitorWidth))
m.y = max(0, min(m.y, monitorHeight))
Just to add in.
Congrats on such a wonderful brilliant script. I love it!
I am using a Macbook Pro M3 with a ASUS monitor. I start the script using vscode on the Macbook, and the Mac is on the left screen 1. When I move from the Macbook and move the mouse to the right to the Monitor, the cat does follow, but the cat does not arrive on the monitor from the left handside, but from the right hand side.
The cat can't follow the mouse back to the Macbook going left, so the cat is stuck on the monitor. He's sleeping now.
If you need any testing, let me know.