Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 311:e6a5f3100b6a
first set single display size from initData
author | oc |
---|---|
date | Fri, 23 Jan 2015 18:20:54 +0900 |
parents | 9b70bfdef8bd |
children | b4718b491ae9 |
files | src/main/java/com/glavsoft/rfb/protocol/state/InitState.java src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 3 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Fri Jan 23 15:43:34 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Fri Jan 23 18:20:54 2015 +0900 @@ -83,10 +83,10 @@ settings.enableAllEncodingCaps(); completeContextData(serverInitMessage, originalInitData); } else { - ProtocolSettings settings = context.getSettings(); settings.enableAllEncodingCaps(); completeContextData(serverInitMessage); + super.rfb.setSingleDisplaySize(serverInitMessage.getFrameBufferWidth(), serverInitMessage.getFrameBufferHeight()); } }
--- a/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Fri Jan 23 15:43:34 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Fri Jan 23 18:20:54 2015 +0900 @@ -197,7 +197,7 @@ '}'; } - public void fitScreen(int thisScreenWidth, int thisScreenHeight, int singleWidth, int singleHeight) { + public double fitScreen(int thisScreenWidth, int thisScreenHeight, int singleWidth, int singleHeight) { double doubleThisWidth = (double) thisScreenWidth; double doubleThisHeight = (double) thisScreenHeight; double widthScale = (doubleThisWidth/singleWidth); @@ -217,5 +217,6 @@ } setScalePercent(scaleFactor); fireListeners(); + return scaleFactor; } }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Fri Jan 23 15:43:34 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Fri Jan 23 18:20:54 2015 +0900 @@ -923,13 +923,14 @@ if (!viewer.getRfb().isTreeManager()) { context.sendMessage(new RequestSingleDisplayWidth()); } - uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight); + double scalePercent = uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight); /* Dimension scaleSize = new Dimension(); scaleSize.setSize(thisScreenWidth * scaleFactor, thisScreenHeight * scaleFactor); frame.setSize(scaleSize); */ - frame.setSize(thisScreenWidth, thisScreenHeight); +// frame.setSize(thisScreenWidth, thisScreenHeight); + uiSettings.setScalePercent(scalePercent); } }); kbdButtons.add(fitScreenButton);