Mercurial > hg > Applications > TreeVNC
changeset 319:f2b835466a24
fix send initData
author | oc |
---|---|
date | Fri, 30 Jan 2015 15:37:03 +0900 |
parents | d01d56038dd1 |
children | a237c7e3b7ca |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java |
diffstat | 3 files changed, 11 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Thu Jan 29 14:16:59 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Jan 30 15:37:03 2015 +0900 @@ -26,6 +26,7 @@ // TreeVNC handling int dataLen = getZrleLength(rect, reader); byte[] bytes = new byte[rect.width * rect.height * renderer.getBytesPerPixel()]; +// byte[] bytes = new byte[renderer.getWidth() * renderer.getHeight() * renderer.getBytesPerPixel()]; reader.reset(); if (rfb.hasViewer()) { ZRLEDecoder decoder = new ZRLEDecoder();
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java Thu Jan 29 14:16:59 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java Fri Jan 30 15:37:03 2015 +0900 @@ -221,13 +221,15 @@ void sendInitData(Writer os) throws TransportException { ProtocolContext context = rfb.context; - if (context != null && rfb.filterSingleDisplay) { - int width = rfb.getSingleWidth(); - int height = rfb.getSingleHeight(); - byte[] initData = createOriginalInitData(width, height, context.getRemoteDesktopName()); - os.write(initData); - } else if (context != null) { - os.write(context.getInitData()); + if (context != null) { + if (rfb.filterSingleDisplay) { + int width = rfb.getSingleWidth(); + int height = rfb.getSingleHeight(); + byte[] initData = createOriginalInitData(width, height, context.getRemoteDesktopName()); + os.write(initData); + } else { + os.write(context.getInitData()); + } } else { // In case of "-d" we have no context // Send dummy data
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java Thu Jan 29 14:16:59 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java Fri Jan 30 15:37:03 2015 +0900 @@ -135,7 +135,7 @@ public void paintComponent(Graphics g) { if (null == renderer) return; ((Graphics2D)g).scale(scaleFactor, scaleFactor); - ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); synchronized (renderer.getLock()) { Image offscreenImage = renderer.getOffscreenImage(); if (offscreenImage != null) {