Mercurial > hg > Applications > TreeVNC
changeset 305:0ee520f535c9
fix initData
author | oc |
---|---|
date | Wed, 21 Jan 2015 11:53:35 +0900 |
parents | d2a56d7d4b2d |
children | 5e55cc34f789 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 3 files changed, 18 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Tue Jan 20 16:40:30 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Wed Jan 21 11:53:35 2015 +0900 @@ -315,11 +315,11 @@ } public void sendSingleDisplaySize(int singleDisplayWidth, int singleDisplayHeight) throws UnsupportedEncodingException { - LinkedList<ByteBuffer> linkedListSendSingleDisplayWidth = new LinkedList<ByteBuffer>(); + LinkedList<ByteBuffer> linkedListSendSingleDisplaySize = new LinkedList<ByteBuffer>(); SendSingleDisplaySize sendSingleDisplaySize = new SendSingleDisplaySize(); - linkedListSendSingleDisplayWidth.add(sendSingleDisplaySize.singleDisplaySize(0, 0, singleDisplayWidth, singleDisplayHeight)); - addSerialNumber(linkedListSendSingleDisplayWidth); - multicastqueue.put(linkedListSendSingleDisplayWidth); + linkedListSendSingleDisplaySize.add(sendSingleDisplaySize.singleDisplaySize(0, 0, singleDisplayWidth, singleDisplayHeight)); + addSerialNumber(linkedListSendSingleDisplaySize); + multicastqueue.put(linkedListSendSingleDisplaySize); System.out.println(singleDisplayWidth + " : send single display width"); } @@ -485,11 +485,12 @@ if (filterSingleDisplay) { width = singleWidth; height = singleHeight; - TreeVncCommandChannelListener hoge = new TreeVncCommandChannelListener(this, acceptPort); - initData = hoge.createOriginalInitData(width, height, context.getRemoteDesktopName()); -// byte[] initData = createOriginalInitData(width, height, context.getRemoteDesktopName()); + TreeVncCommandChannelListener treeVncCommandChannelListener = new TreeVncCommandChannelListener(this, acceptPort); + initData = treeVncCommandChannelListener.createOriginalInitData(width, height, context.getRemoteDesktopName()); + desktopSize.add(new ChengeDesktopSize(singleWidth, singleHeight, EncodingType.INIT_DATA, initData, id).getMessage()); + } else { + desktopSize.add(new ChengeDesktopSize(width, height, EncodingType.INIT_DATA, context.getInitData(), id).getMessage()); } - desktopSize.add(new ChengeDesktopSize(width, height, EncodingType.INIT_DATA, initData,id).getMessage()); addSerialNumber(desktopSize); multicastqueue.put(desktopSize); }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java Tue Jan 20 16:40:30 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java Wed Jan 21 11:53:35 2015 +0900 @@ -221,15 +221,13 @@ void sendInitData(Writer os) throws TransportException { ProtocolContext context = rfb.context; - if (context != null) { - if (rfb.filterSingleDisplay) { - int width = rfb.singleWidth; - int height = rfb.singleHeight; - byte[] initData = createOriginalInitData(width, height, context.getRemoteDesktopName()); - os.write(initData); - } else { - os.write(context.getInitData()); - } + if (context != null && rfb.filterSingleDisplay) { + int width = rfb.singleWidth; + int height = rfb.singleHeight; + byte[] initData = createOriginalInitData(width, height, context.getRemoteDesktopName()); + os.write(initData); + } else if (context != null) { + 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/SwingViewerWindow.java Tue Jan 20 16:40:30 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Wed Jan 21 11:53:35 2015 +0900 @@ -881,6 +881,7 @@ }); kbdButtons.add(screenButton); + /* final JButton soundButton = buttonsBar.createButton("share-sound", "Shara Sound", new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -888,6 +889,7 @@ } }); kbdButtons.add(soundButton); + */ final JButton adjustHdSizeButton = buttonsBar.createButton("adjust-hd", "Adjust Hd Size", new ActionListener() { @Override