Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple monitors #31

Open
mikefirefly opened this issue Jul 3, 2024 · 6 comments
Open

Multiple monitors #31

mikefirefly opened this issue Jul 3, 2024 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mikefirefly
Copy link

mikefirefly commented Jul 3, 2024

I have this monitor configuration:

image

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)).
@crgimenes crgimenes added bug Something isn't working help wanted Extra attention is needed labels Jul 3, 2024
@crgimenes
Copy link
Owner

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.

@soucelover
Copy link

@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.

@crgimenes
Copy link
Owner

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.

@mikefirefly
Copy link
Author

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!

@crgimenes
Copy link
Owner

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))

@davidtkeane
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants