Martin9527 / premotedroid

Automatically exported from code.google.com/p/premotedroid
0 stars 0 forks source link

When attempting to move mouse pass the edge of the screen, connection is severed #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect via Bluetooth (may occur with wifi as well)
2. Attempt to move mouse past any edge of the monitor
3. Exception is thrown

What is the expected output? What do you see instead?
The connection should remain.  Instead, the connection gets severed.

What version of the product are you using? On what operating system?
v1.0 Mac OS X

Please provide any additional information below.
Should be a fairly easy fix.  I would have just fixed it myself, but I had 
trouble getting it running from source.

Exception in thread "Thread-11" java.lang.NullPointerException
    at org.pierre.remotedroid.server.connection.PRemoteDroidServerConnection.moveMouse(PRemoteDroidServerConnection.java:159)
    at org.pierre.remotedroid.server.connection.PRemoteDroidServerConnection.action(PRemoteDroidServerConnection.java:101)
    at org.pierre.remotedroid.server.connection.PRemoteDroidServerConnection.run(PRemoteDroidServerConnection.java:75)
    at java.lang.Thread.run(Thread.java:637)

Original issue reported on code.google.com by bradpitc...@gmail.com on 23 Sep 2010 at 3:20

GoogleCodeExporter commented 9 years ago
Ok, i'll try to fix that, in the next release

Original comment by pierredu...@gmail.com on 26 Sep 2010 at 1:49

GoogleCodeExporter commented 9 years ago
It looks like you fixed the issue by checking against (pointerInfo != null).
Now the behavior for me is the following: I get no Excepton, but the moment I 
move the cursor to the corner of the screen even once, it becomes unresponsive. 
I have to move it back into the screen with the mouse installed on the system 
before I can move it again with the remote.
This seems to be caused by MouseInfo.getPointerInfo() consistently returning 
null after the Robot moved the mouse beyond the dimensions of the screen. I 
kind of fixed it with the following lines:
x = x < 0 ? 0 : (x >= screenDim.width ? screenDim.width - 1 : x);
y = y < 0 ? 0 : (y >= screenDim.height ? screenDim.height - 1 : y);
this.application.getRobot().mouseMove(x, y);

But this prevents me from moving the mouse to a secondary screen (where the x 
coordinate is indeed negative). Probably you can find a better way.

TLDR: check the coordinates against the screen size before calling 
.mouseMove(x,y), at least for MacOSX

Original comment by reimann....@gmail.com on 9 Feb 2011 at 8:24

GoogleCodeExporter commented 9 years ago
Same behavior - moving to the screen edges causes connection loss.

On OSX 10.6.8 and 

java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)

the stack trace now looks like: 

java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:250)
    at org.pierre.remotedroid.protocol.action.PRemoteDroidAction.parse(PRemoteDroidAction.java:23)
    at org.pierre.remotedroid.protocol.PRemoteDroidConnection.receiveAction(PRemoteDroidConnection.java:30)
    at org.pierre.remotedroid.server.connection.PRemoteDroidServerConnection.run(PRemoteDroidServerConnection.java:73)
    at java.lang.Thread.run(Thread.java:680)

Original comment by schnee...@gmail.com on 13 Jul 2011 at 2:36

GoogleCodeExporter commented 9 years ago
In my situation, it only jumps to top left corner and that makes it impossible 
to use hidden dock or hot corners.

Original comment by fcanimi...@gmail.com on 12 Oct 2011 at 8:43