Mercurial > hg > Applications > TreeVNC
changeset 353:eba44a31e868
remove filterSingleDisplay option in retina version
author | oc |
---|---|
date | Mon, 23 Feb 2015 17:43:45 +0900 |
parents | 7ac43be7e291 |
children | 7ef4ac588459 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/com/glavsoft/rfb/protocol/state/InitState.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java |
diffstat | 5 files changed, 16 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Feb 23 15:31:55 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Feb 23 17:43:45 2015 +0900 @@ -89,7 +89,7 @@ if(!rfb.getCuiVersion()) if (rfb.filterSingleDisplay) { - renderer = repaintController.createRenderer(reader, rfb.getSingleWidth(), rfb.getSingleHeight(), context.getPixelFormat()); + renderer = repaintController.createRenderer(reader, context.getFbWidth(), context.getFbHeight(), context.getPixelFormat()); fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, rfb.getSingleWidth(), rfb.getSingleHeight(), true); } else { renderer = repaintController.createRenderer(reader, context.getFbWidth(), context.getFbHeight(), context.getPixelFormat()); @@ -183,7 +183,7 @@ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); te.printStackTrace(pw); - logger.severe(te.getMessage()); + logger.severe("updateRectangle record failed : " + te.getMessage()); if (isRunning) { context.cleanUpSession(te.getMessage() + "\n" + sw.toString()); } @@ -220,7 +220,7 @@ clipboardController.updateSystemClipboard(reader.readBytes(length)); } - public void framebufferUpdateMessage() throws CommonException { + public void framebufferUpdateMessage() throws Exception { try { reader.readByte(); // padding @@ -236,10 +236,14 @@ Decoder decoder = decoders.getDecoderByType(rect.getEncodingType()); logger.finest(rect.toString() + (0 == numberOfRectangles ? "\n---" : "")); if (decoder != null) { - decoder.decode(reader, renderer, rect); // TreeVNC processing here - if (rfb.getCuiVersion()) continue; - if (rfb.filterSingleDisplay && rect.x >= rfb.getSingleWidth()) continue; - repaintController.repaintBitmap(rect); + try { + decoder.decode(reader, renderer, rect); // TreeVNC processing here + if (rfb.getCuiVersion()) continue; + if (rfb.filterSingleDisplay && rect.x >= rfb.getSingleWidth()) continue; + repaintController.repaintBitmap(rect); + } catch (Exception e) { + throw e; + } } else if (rect.getEncodingType() == EncodingType.RICH_CURSOR) { RichCursorDecoder.getInstance().decode(reader, renderer, rect); if(repaintController!=null)
--- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Mon Feb 23 15:31:55 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Mon Feb 23 17:43:45 2015 +0900 @@ -79,6 +79,7 @@ context.setPixelFormat(serverInitMessage.getPixelFormat()); context.setFbWidth(serverInitMessage.getFrameBufferWidth()); context.setFbHeight(serverInitMessage.getFrameBufferHeight()); + System.out.println("serverInit : width : " + context.getFbWidth() + " height : " + context.getFbHeight()); context.setRemoteDesktopName(serverInitMessage.getName()); context.setInitData(serverInitMessage.getInitData()); }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Feb 23 15:31:55 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Feb 23 17:43:45 2015 +0900 @@ -531,7 +531,7 @@ byte[] initData = null; if (filterSingleDisplay) { - this.originalInitData = createOriginalInitData(singleWidth, singleHeight, context.getRemoteDesktopName()); + originalInitData = createOriginalInitData(singleWidth, singleHeight, context.getRemoteDesktopName()); // desktopSize.add(new ChengeDesktopSize(singleWidth, singleHeight, EncodingType.INIT_DATA, originalInitData, id).getMessage()); desktopSize.add(new ChengeDesktopSize(width, height, EncodingType.INIT_DATA, context.getInitData(), id).getMessage()); } else {
--- a/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Mon Feb 23 15:31:55 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Mon Feb 23 17:43:45 2015 +0900 @@ -204,12 +204,10 @@ double heightScale = (doubleThisHeight/singleHeight); double defaultScaleFactor = 100.0; double scaleFactor = 100.0; - double diff = widthScale - heightScale; - if(diff == 0) { + if (widthScale > heightScale) { scaleFactor = defaultScaleFactor * widthScale; - setScalePercent(scaleFactor); - } else if(diff > 0) { + } else { scaleFactor = defaultScaleFactor * heightScale; } if (scaleFactor > MAX_SCALE_PERCENT) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java Mon Feb 23 15:31:55 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java Mon Feb 23 17:43:45 2015 +0900 @@ -114,7 +114,7 @@ synchronized (renderer.getLock()) { cursor = renderer.getCursor(); } - init(renderer.getWidth(), renderer.getHeight()); +// init(renderer.getWidth(), renderer.getHeight()); updateFrameSize(); return renderer; }