Mercurial > hg > Applications > TreeVNC
diff src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java @ 391:6a8b661367c6
Fix serverChange desktop size
author | innparusu |
---|---|
date | Tue, 22 Sep 2015 19:09:22 +0900 |
parents | aef5cbdd84ab |
children | 319447659dc6 |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Sep 22 16:18:55 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Sep 22 19:09:22 2015 +0900 @@ -288,9 +288,11 @@ byte[] initData = new byte[length]; reader.read(initData); String name = new String(initData, 24, length - 24, "UTF-8"); - rfb.getContext().setRemoteDesktopName(name); - rfb.getContext().setInitData(initData); - repaintController.updateRemoteDesktopName(rfb.getContext()); + context.setRemoteDesktopName(name); + context.setInitData(initData); + context.setFbWidth(rect.width); + context.setFbHeight(rect.height); + repaintController.updateRemoteDesktopName(context); reader.reset(); // All children multicastqueue should be discarded hear. // rfb.clearChildrenTransmission(); @@ -299,8 +301,11 @@ visible = (id != rfb.getId()); } synchronized (renderer.getLock()) { - if(!(rfb.getCuiVersion())) + if(!(rfb.getCuiVersion())) { renderer = repaintController.createRenderer(reader, rect.width, rect.height, context.getPixelFormat()); + + System.out.println("ReceiverTask INIT_DATA width =" +rect.width+ " height =" +rect.height); + } } if (rect.getEncodingType() == EncodingType.INIT_DATA) { repaintController.setVisible(visible); @@ -308,8 +313,10 @@ if (rfb.hasViewer()){ rfb.getViewer().setFitScreen(); } - context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); - // repaintController.repaintCursor(); + if (rfb.isTreeManager()) { + context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); + } + } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY) { int checkDelaySize = 24; reader.reset();