Mercurial > hg > Applications > TreeVNC
changeset 307:7e8b070dc15b
create renderer filterSingleDisplay
author | oc |
---|---|
date | Thu, 22 Jan 2015 01:01:29 +0900 |
parents | 5e55cc34f789 |
children | d1d6c7306281 |
files | src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/com/glavsoft/rfb/protocol/state/InitState.java |
diffstat | 3 files changed, 34 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Wed Jan 21 19:05:21 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Thu Jan 22 01:01:29 2015 +0900 @@ -314,7 +314,7 @@ if (receiverTask != null) { receiverTask.stopTask(); try { - receiverThread.join(); + receiverThread.join(1000); } catch (InterruptedException e) { // nop }
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Wed Jan 21 19:05:21 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Jan 22 01:01:29 2015 +0900 @@ -88,8 +88,13 @@ decoders.setDecoderByType(EncodingType.ZRLEE, decoder); if(!rfb.getCuiVersion()) - renderer = repaintController.createRenderer(reader, context.getFbWidth(), context.getFbHeight(),context.getPixelFormat()); - fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true); + if (rfb.filterSingleDisplay) { + renderer = repaintController.createRenderer(reader, rfb.getSingleWidth(), rfb.getSingleHeight(), context.getPixelFormat()); + fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, rfb.getSingleWidth(), rfb.getSingleHeight(), true); + } else { + renderer = repaintController.createRenderer(reader, context.getFbWidth(), context.getFbHeight(), context.getPixelFormat()); + fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true); + } if(rfb.isTreeManager()) { // これを定期的にフルサイズのframebufferUpdateを送信するThreadにしよう! fullscreenFbUpdateIncrementalRequest.sendFullScreenRequest();
--- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Wed Jan 21 19:05:21 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Thu Jan 22 01:01:29 2015 +0900 @@ -74,11 +74,34 @@ protected void clientAndServerInit() throws TransportException { ServerInitMessage serverInitMessage = getServerInitMessage(); - ProtocolSettings settings = context.getSettings(); - settings.enableAllEncodingCaps(); - completeContextData(serverInitMessage); + + if (super.rfb.filterSingleDisplay) { + singleWidth = super.rfb.getSingleWidth(); + singleHeight = super.rfb.getSingleHeight(); + originalInitData = super.rfb.createOriginalInitData(singleWidth, singleHeight, serverInitMessage.getName()); + ProtocolSettings settings = context.getSettings(); + settings.enableAllEncodingCaps(); + completeContextData(serverInitMessage, originalInitData); + } else { + + ProtocolSettings settings = context.getSettings(); + settings.enableAllEncodingCaps(); + completeContextData(serverInitMessage); + } } + public void completeContextData(ServerInitMessage serverInitMessage, byte[] originalInitData) { + context.setPixelFormat(serverInitMessage.getPixelFormat()); + context.setFbWidth(singleWidth); + context.setFbHeight(singleHeight); + context.setFbWidth(serverInitMessage.getFrameBufferWidth()); + context.setFbHeight(serverInitMessage.getFrameBufferHeight()); + + context.setRemoteDesktopName(serverInitMessage.getName()); + context.setInitData(originalInitData); + } + + public void completeContextData(ServerInitMessage serverInitMessage) { context.setPixelFormat(serverInitMessage.getPixelFormat()); context.setFbWidth(serverInitMessage.getFrameBufferWidth());