# HG changeset patch # User oc # Date 1421047846 -32400 # Node ID 61938de1dd06f954a864bb8d0900f91e27199f4c # Parent 6ad14086225e1fbe23fc32f467e6370b1490d8c3 fix sendSingleDisplayWidth() timing diff -r 6ad14086225e -r 61938de1dd06 src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java Sun Jan 11 07:44:25 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java Mon Jan 12 16:30:46 2015 +0900 @@ -27,9 +27,9 @@ private String proxyAddr; /** - * To find vnc root, a client sends a multicast packet. + * To find vnc root, a client sends a multicast packet. + * @param _port * @param createConnectionParam - * @param _str */ public FindRoot(int _port, CreateConnectionParam createConnectionParam) { CreateConnectionParam cp = createConnectionParam; diff -r 6ad14086225e -r 61938de1dd06 src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sun Jan 11 07:44:25 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Jan 12 16:30:46 2015 +0900 @@ -177,6 +177,7 @@ int frameSizeWidth = buf.getInt(); int frameSizeHeight = buf.getInt(); singleWidth = frameSizeWidth; + sendSingleDisplayWidth(singleWidth); System.out.println("Root server change request :" + newHostName); // please remove these numbers. if (viewer != null) { @@ -189,7 +190,6 @@ ByteBuffer buf = ByteBuffer.wrap(b); buf.order(ByteOrder.BIG_ENDIAN); buf.get(); - // ここにエンコーディングタイプがSendSingleDisplayWidthなframebufferUpdateを送信する処理を書く sendSingleDisplayWidth(singleWidth); } else if (b[0] == ClientToServerMessage.CHECK_DELAY_REPLY) { ByteBuffer buf = ByteBuffer.wrap(b); diff -r 6ad14086225e -r 61938de1dd06 src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java --- a/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Sun Jan 11 07:44:25 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Mon Jan 12 16:30:46 2015 +0900 @@ -109,12 +109,9 @@ } public void adjustHdSize(int width) { - // 今の画面サイズを取得 - // uiSettingsData.getScalePercent()を取得 - // 1920x1080にするためにはscaleを何に設定すれば良いのかを計算する double hdWidth = 1920.0; - double oldScaleFactor = uiSettingsData.getScalePercent(); - double scaleFactor = (hdWidth / width) * 100.0; + double defaultScaleFactor = 100.0; + double scaleFactor = (hdWidth / width) * defaultScaleFactor; if (scaleFactor > MAX_SCALE_PERCENT) { scaleFactor = MAX_SCALE_PERCENT; } diff -r 6ad14086225e -r 61938de1dd06 src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java --- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Jan 11 07:44:25 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jan 12 16:30:46 2015 +0900 @@ -873,7 +873,6 @@ if (viewer.getRfb().isTreeManager()) { try { viewer.getRfb().changeVNCServer(viewer, "127.0.0.1", (int) rectangles.get(leftScreenNumber).getWidth(), (int) rectangles.get(leftScreenNumber).getHeight(), viewer.getRfb().getId()); - context.sendMessage(new RequestSingleDisplayWidth()); } catch (Exception e1) { System.out.println("can't change server :" + e1.getMessage()); } @@ -881,7 +880,6 @@ } String adr = viewer.getRfb().getMyAddress(); context.sendMessage(new ScreenChangeRequest(adr, viewer.getRfb().getId(), (int) rectangles.get(leftScreenNumber).getWidth(), (int) rectangles.get(leftScreenNumber).getHeight())); - context.sendMessage(new RequestSingleDisplayWidth()); } }); kbdButtons.add(screenButton);