# HG changeset patch
# User Nozomi
# Date 1465386847 -32400
# Node ID 7eaa95ca7e45387599137b819649cde79d5aae4c
# Parent 340b62546e0a781cca39be590ecb81231ae2defa
trying to fix fitScreen
diff -r 340b62546e0a -r 7eaa95ca7e45 .idea/compiler.xml
--- a/.idea/compiler.xml Wed Feb 17 09:57:15 2016 +0900
+++ b/.idea/compiler.xml Wed Jun 08 20:54:07 2016 +0900
@@ -1,7 +1,6 @@
-
diff -r 340b62546e0a -r 7eaa95ca7e45 .idea/encodings.xml
--- a/.idea/encodings.xml Wed Feb 17 09:57:15 2016 +0900
+++ b/.idea/encodings.xml Wed Jun 08 20:54:07 2016 +0900
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff -r 340b62546e0a -r 7eaa95ca7e45 .idea/gradle.xml
--- a/.idea/gradle.xml Wed Feb 17 09:57:15 2016 +0900
+++ b/.idea/gradle.xml Wed Jun 08 20:54:07 2016 +0900
@@ -3,9 +3,10 @@
\ No newline at end of file
diff -r 340b62546e0a -r 7eaa95ca7e45 .idea/vcs.xml
--- a/.idea/vcs.xml Wed Feb 17 09:57:15 2016 +0900
+++ b/.idea/vcs.xml Wed Jun 08 20:54:07 2016 +0900
@@ -2,6 +2,5 @@
-
\ No newline at end of file
diff -r 340b62546e0a -r 7eaa95ca7e45 .idea/workspace.xml
--- a/.idea/workspace.xml Wed Feb 17 09:57:15 2016 +0900
+++ b/.idea/workspace.xml Wed Jun 08 20:54:07 2016 +0900
@@ -1,8 +1,16 @@
-
-
+
+
+
+
+
+
+
+
+
+
@@ -16,252 +24,110 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -890,17 +613,30 @@
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -909,34 +645,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -947,8 +655,6 @@
-
-
@@ -1022,7 +728,6 @@
-
@@ -1153,7 +858,7 @@
-
+
@@ -1196,105 +901,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
@@ -1304,717 +918,83 @@
-
- 1438850843613
+
+ 1465382253216
- 1438850843613
-
-
- 1438857808190
-
-
- 1438857808190
+ 1465382253216
-
- 1438858871242
-
-
- 1438858871242
-
-
- 1438859488912
-
-
- 1438859488912
-
-
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java
- 508
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java
- 881
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java
- 439
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 533
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/Protocol.java
- 312
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java
- 82
-
-
-
-
+
file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java
- 252
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java
- 122
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommand.java
- 117
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/state/HandshakeState.java
- 60
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java
- 101
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncProtocol.java
- 53
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java
- 163
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java
- 57
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java
- 42
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java
- 33
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncRootSelectionPanel.java
- 91
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommand.java
- 50
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java
- 199
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java
- 173
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/Protocol.java
- 90
+ 326
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 499
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java
- 115
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java
- 229
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java
- 166
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/ScreenChangeRequest.java
- 27
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 643
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java
- 152
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/ScreenChangeRequest.java
- 39
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/encoding/decoder/FramebufferUpdateRectangle.java
- 65
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java
- 918
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java
- 490
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java
- 38
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 525
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/ChengeDesktopSize.java
- 13
-
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java
- 55
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java
- 925
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 293
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 273
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/RequestScreenThread.java
- 30
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 415
-
-
-
-
- file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingNetworkConnectionWorker.java
- 174
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java
- 127
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -2022,184 +1002,60 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No facets are configured
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
- TreeVNC
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
- Gradle: com.jcraft:jsch:0.1.50
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 340b62546e0a -r 7eaa95ca7e45 Todo.txt
--- a/Todo.txt Wed Feb 17 09:57:15 2016 +0900
+++ b/Todo.txt Wed Jun 08 20:54:07 2016 +0900
@@ -1,3 +1,11 @@
+Wed June 8 15:35 JST 2016 kono
+
+ Multi screen でfitScreen buttonは左では動く
+ 右ではoriginがずれる
+
+ fitScreenをclient側で自動的に実行する
+ multi screenのoriginを考慮してfitScreenする
+
Wed Jan 28 15:35 JST 2015
< 現状の問題点 >
diff -r 340b62546e0a -r 7eaa95ca7e45 TreeVNC.iml
--- a/TreeVNC.iml Wed Feb 17 09:57:15 2016 +0900
+++ b/TreeVNC.iml Wed Jun 08 20:54:07 2016 +0900
@@ -18,6 +18,14 @@
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 340b62546e0a -r 7eaa95ca7e45 src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Wed Feb 17 09:57:15 2016 +0900
+++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Wed Jun 08 20:54:07 2016 +0900
@@ -919,7 +919,7 @@
int singleWidth = (int) (rectangles.get(shareScreenNumber).getWidth());
int singleHeight = (int) (rectangles.get(shareScreenNumber).getHeight());
viewer.getRfb().setSingleDisplaySize(singleWidth, singleHeight);
- int x = (int) (rectangles.get(shareScreenNumber).getX());
+ int x = (int) (rectangles.get(shareScreenNumber).getX()); // convert double to int
int y = (int) (rectangles.get(shareScreenNumber).getY());
// Fix invalid x, y position.
@@ -975,7 +975,7 @@
Object retinaScale = field.get(devices[shareScreenNumber]);
if (retinaScale instanceof Integer) {
- scale = (int)retinaScale;
+ scale = (Integer) retinaScale;
return scale;
}
}
@@ -998,15 +998,24 @@
}
}
+ /**
+ * change screen viewer scale to fit the server screen size
+ */
public void fitScreen() {
ArrayList rectangles = viewer.getScreenRectangles();
int leftScreenNumber = 0;
int thisScreenWidth = (int) rectangles.get(leftScreenNumber).getWidth();
int thisScreenHeight = (int) rectangles.get(leftScreenNumber).getHeight();
+
+ int thatScreenX = (int) presenter.getX();
+ int thatScreenY = (int) presenter.getY();
+
int singleWidth = viewer.getRfb().getSingleWidth() * viewer.getRfb().getRetinaScale();
int singleHeight = viewer.getRfb().getSingleHeight() * viewer.getRfb().getRetinaScale();
frame.setSize(thisScreenWidth, thisScreenHeight);
+ Rectangle visible = new Rectangle(thatScreenX,thatScreenY,thisScreenWidth,thisScreenHeight);
+ scroller.scrollRectToVisible(visible);
uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight);
}