Aqueuse / NekoV2

Neko application for the desktop, enhanced with a catchable ball of yarn, and independent behavior and a basket to sleep in when you need a break
GNU General Public License v3.0
25 stars 5 forks source link

neko doesnt go between monitors if one monitor is of lower resolution #12

Open Jankeczek opened 7 months ago

Jankeczek commented 7 months ago

neko will go from the bigger (in terms of resolution) to the smaller monitor but not vice versa, it just teleports back to the smaller monitor

how it works:

https://github.com/Aqueuse/NekoV2/assets/95749943/8a5cefb0-2db2-4f1a-8dd5-39cbe5dfcd64

how it should work:

https://github.com/Aqueuse/NekoV2/assets/95749943/85fd74d7-56ec-40ee-a0e8-d067caf18c10

Aqueuse commented 7 months ago

Amazing :O sadly I don't have two screens with different resolutions to debug this but I will scratch my head on it. Thank you for the issue !

techguyone commented 4 months ago

My Neko doesn't even move between two monitors that are the same model and resolution although the accessories like the ball of wool do. Windows 11

Aqueuse commented 4 months ago

My Neko doesn't even move between two monitors that are the same model and resolution although the accessories like the ball of wool do. Windows 11

hello, is it the same in all the different modes ? (follow the mouse, independant, etc)

techguyone commented 4 months ago

Yes it seems to be stuck to one screen only sadly regardless of mode.

Aqueuse commented 4 months ago

what java version do you use to run Neko ? @techguyone

techguyone commented 4 months ago

Checking now:

jre-8u421-windows-x64

My monitors are Dell S2722DGM running 2K resolution

As it reaches the edge, it momentarily appears on the second monitor and then disappears and re-appears in the centre of the original monitor.

Aqueuse commented 4 months ago

@techguyone could I know the spatial configuration of your screens ? are they stacked vertically, horizontally, an other way ?

techguyone commented 4 months ago

I have 3, one is only a small 9 inch system panel though. The two main ones are 27 inch side by side horizontally. The nekop uses screen 1 only

Screenshot 2024-07-16 193037

Aqueuse commented 4 months ago

@techguyone thank you, I will investigate with all this informations and find a solution. For the moment, Neko is moving in a rectangle witch contain all the screens, but I don't have test it on three screens so it will be needed. I think for the last version to a solution where you could choose between the possible screens and neko will have a non rectangular field to move in, but it will need some work ^^

Aqueuse commented 4 months ago

Could you test with two screens (1 and 2) and tell me the result ? (you will need to relaunch Neko)

techguyone commented 4 months ago

Of course.

I disconnected my 3rd monitor (1280 x 400) 60 Hz refresh which is just used as a system monitor panel, leaving only the 2 x 27 inch dell monitors (2560 x 1440) 166 Hz refresh. Sadly nothing changed, the Neko only reaches the border then reappears in the centre of Display 1 I wonder is the neko only designed to work with1080p monitors ?

Aqueuse commented 4 months ago

Of course.

I disconnected my 3rd monitor (1280 x 400) 60 Hz refresh which is just used as a system monitor panel, leaving only the 2 x 27 inch dell monitors (2560 x 1440) 166 Hz refresh. Sadly nothing changed, the Neko only reaches the border then reappears in the centre of Display 1 I wonder is the neko only designed to work with1080p monitors ?

Thank you so much for your help.

Actually no, Neko should work with any display of any size. The management of his playground is in the Pet class :

https://github.com/Aqueuse/NekoV2/blob/master/src/pet/Pet.java

    public Rectangle getVirtualScreenRectangle() {
        Rectangle virtualBounds = new Rectangle();

        GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] screenDevices = graphicsEnvironment.getScreenDevices();

        for (GraphicsDevice graphicsDevice : screenDevices) {
            GraphicsConfiguration[] graphicsConfigurations = graphicsDevice.getConfigurations();
            for (GraphicsConfiguration graphicsConfiguration : graphicsConfigurations) {
                virtualBounds = virtualBounds.union(graphicsConfiguration.getBounds());
            }
        }

        return virtualBounds;
    }

This is what Neko use to know where he can go (and also the toy), but what is strange is that you tell me that the toy work correctly ?

I will need to replicate your issue very precisely I think to find what is happening (and provide more options in the settings, as it's programmed, to exclude/include screens and crop the playground of neko, that would be awesome).

You must know that I use Neko, with these exact code, on two screens of 1920*1080px horizontally stack and it's working perfectly fine. I'm very sad that you have problem, but the next release, your experience will help me a lot.

Maybe you have an idea about why

            for (GraphicsConfiguration graphicsConfiguration : graphicsConfigurations) {
                virtualBounds = virtualBounds.union(graphicsConfiguration.getBounds());
            }

don't work for you ? It's pretty embarassing. If I find time these evening, I will find on the web some usecase like yours in the hope that it could help me to understand.

If I find a fix, I will do a new release ASAP.