Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 348:6f67d602b8e9
merge
author | oc |
---|---|
date | Thu, 12 Feb 2015 16:42:11 +0900 |
parents | 1f86df6504b7 (current diff) 89c41f9870ba (diff) |
children | cbd794a31eee |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 3 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Thu Feb 12 15:48:55 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Thu Feb 12 16:42:11 2015 +0900 @@ -42,7 +42,7 @@ return; } } - rfb.readSendData(dataLen, reader, bytes, rect); + rfb.readSendData(dataLen, reader, bytes, rect); } private int getZrleLength(FramebufferUpdateRectangle rect, Reader reader)
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Feb 12 15:48:55 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Feb 12 16:42:11 2015 +0900 @@ -292,6 +292,7 @@ throw new CommonException("Unprocessed encoding: " + rect.toString()); } } catch (UnsupportedEncodingException e) { + e.getMessage(); e.printStackTrace(); reader.close(); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Thu Feb 12 15:48:55 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Thu Feb 12 16:42:11 2015 +0900 @@ -853,11 +853,14 @@ @Override public void actionPerformed(ActionEvent e) { viewer.setVisible(false); + + float scaleFactor = getMyDisplayScaleFactor(); ArrayList<Rectangle> rectangles = viewer.getScreenRectangles(); int leftScreenNumber = 0; - int singleWidth = (int) rectangles.get(leftScreenNumber).getWidth(); - int singleHeight = (int) rectangles.get(leftScreenNumber).getHeight(); + int singleWidth = (int) (rectangles.get(leftScreenNumber).getWidth() * scaleFactor); + int singleHeight = (int) (rectangles.get(leftScreenNumber).getHeight() * scaleFactor); viewer.getRfb().setSingleDisplaySize(singleWidth, singleHeight); + if (viewer.getRfb().isTreeManager()) { if (viewer.getRfb().hasParent()) { String adr = viewer.getRfb().getMyAddress(); @@ -927,7 +930,14 @@ setButtonsBarVisible(true, container); } - + + private float getMyDisplayScaleFactor() { + final String CONTENT_SCALE_FACTOR = "java.awt.contentScaleFactor"; + Float scaleFactor = (Float) Toolkit.getDefaultToolkit().getDesktopProperty(CONTENT_SCALE_FACTOR); + + return scaleFactor == null ? 1.0f : scaleFactor; + } + public void fitScreen() { ArrayList<Rectangle> rectangles = viewer.getScreenRectangles(); int leftScreenNumber = 0;