File tree Expand file tree Collapse file tree
Customer/src/main/java/de/openindex/support/customer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Changelog for Remote Support Tool
441.0.1 (13 Mar 2019)
55-------------------
66
7- ...
7+ - fixed [ issue # 18 ] ( https://github.com/OpenIndex/RemoteSupportTool/issues/18 ) : Mouse is shifted on Windows clients with high resolution screen
88
99
10101.0.0 (20 Oct 2018)
Original file line number Diff line number Diff line change 3838import java .awt .event .ActionEvent ;
3939import java .awt .event .ActionListener ;
4040import java .awt .event .KeyEvent ;
41+ import java .awt .geom .AffineTransform ;
4142import java .awt .image .BufferedImage ;
4243import java .io .ByteArrayOutputStream ;
4344import java .io .File ;
@@ -444,7 +445,27 @@ else if (request.keyChar != KeyEvent.CHAR_UNDEFINED) {
444445 } else if (object instanceof MouseMoveRequest ) {
445446
446447 final MouseMoveRequest request = (MouseMoveRequest ) object ;
447- robot .mouseMove (request .x , request .y );
448+ final int x ;
449+ final int y ;
450+
451+ // On Windows systems we need to convert the coordinates
452+ // according to the current screen scaling factor.
453+ if (SystemUtils .IS_OS_WINDOWS ) {
454+ final GraphicsConfiguration screenConfiguration = screen .getDefaultConfiguration ();
455+ final AffineTransform transform = screenConfiguration .getDefaultTransform ();
456+ final double scaleX = (transform != null && transform .getScaleX () > 0 ) ?
457+ transform .getScaleX () : 1 ;
458+ final double scaleY = (transform != null && transform .getScaleY () > 0 ) ?
459+ transform .getScaleY () : 1 ;
460+
461+ x = (int ) ((double ) request .x / scaleX );
462+ y = (int ) ((double ) request .y / scaleY );
463+ } else {
464+ x = request .x ;
465+ y = request .y ;
466+ }
467+
468+ robot .mouseMove (x , y );
448469
449470 } else if (object instanceof MousePressRequest ) {
450471
You can’t perform that action at this time.
0 commit comments