Mercurial > hg > Applications > TreeVNC
changeset 563:5bbe53b47d0a
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 03 Feb 2020 15:19:30 +0900 |
parents | 87ae979b88cd |
children | 0751cb6c0715 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/jp/ac/u_ryukyu/treevnc/VncProxyService.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java |
diffstat | 4 files changed, 16 insertions(+), 111 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Sun Feb 02 19:58:17 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Mon Feb 03 15:19:30 2020 +0900 @@ -177,8 +177,6 @@ compressAndCheckFlush(rfb, rect, bytes, offset, true, last); } else { compressAndCheckFlush(rfb, rect, bytes, offset, false, last); - - } } } @@ -255,17 +253,17 @@ private void flushMuticast(TreeRFBProto rfb) { c1.flip(); //System.out.println("multicastPut: " + c1rect + " length: " + (c1.remaining()-c1headerPos-header.limit())); - deflater.reset(); + deflater.reset(); - LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); - bufs.add(c1); - rfb.getContext().checkFrameBufferRectanble(c1); - if (rfb.isTreeManager() && rfb.connectionPresenter.isUseMulticast()) { - for (ByteBuffer buf : bufs) - rfb.getViewer().getRfbBroadcastListener().multicastUpdateRectangle(buf); - } else { - rfb.multicastqueue.put(bufs); - } + LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); + bufs.add(c1); + rfb.getContext().checkFrameBufferRectanble(c1); + if (rfb.isTreeManager() && rfb.connectionPresenter.isUseMulticast()) { + for (ByteBuffer buf : bufs) + rfb.getViewer().getRfbBroadcastListener().multicastUpdateRectangle(buf); + } else { + rfb.multicastqueue.put(bufs); + } } }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/VncProxyService.java Sun Feb 02 19:58:17 2020 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -package jp.ac.u_ryukyu.treevnc; - -import java.awt.event.*; -import java.util.logging.Logger; - -import com.glavsoft.core.SettingsChangedEvent; -import com.glavsoft.rfb.IChangeSettingsListener; -import com.glavsoft.rfb.IRfbSessionListener; -import com.glavsoft.rfb.protocol.ProtocolSettings; -import com.glavsoft.viewer.Viewer; -import com.glavsoft.viewer.cli.Parser; -import com.glavsoft.viewer.swing.ParametersHandler; - -public class VncProxyService extends Viewer implements Runnable, - IRfbSessionListener, IChangeSettingsListener { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public static Logger logger = Logger.getLogger("com.glavsoft"); - private boolean forceReconnection; - private String reconnectionReason; - static VncProxyService currentVps; - - public VncProxyService() { - ProtocolSettings.getDefaultSettings(); - uiSettings = super.uiSettings; - } - - - public static void main(String[] argv) { - String[] mainArgs = argv; - System.out.println(mainArgs.length); - // input into arguments Decision - - Parser parser = new Parser(); - ParametersHandler.completeParserOptions(parser); - - parser.parse(argv); - if (parser.isSet(ParametersHandler.ARG_HELP)) { - printUsage(parser.optionsUsage()); - System.exit(0); - } - VncProxyService vps = new VncProxyService(); - vps.initRoot(vps.myRfb, "localhost"); - } - - - - @Override - public void destroy() { - - } - - @Override - public void windowClosing(WindowEvent e) { - if (e != null && e.getComponent() != null) { - e.getWindow().setVisible(false); - } - closeApp(); - } - - @Override - public void rfbSessionStopped(final String reason) { - System.out.println(reason); - } - - @Override - public void settingsChanged(SettingsChangedEvent event) { - } - -}
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Sun Feb 02 19:58:17 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Mon Feb 03 15:19:30 2020 +0900 @@ -1,7 +1,5 @@ package com.glavsoft.viewer; -import jp.ac.u_ryukyu.treevnc.VncProxyService; - import java.io.FileNotFoundException; import java.io.PrintStream; import java.net.SocketException; @@ -70,14 +68,9 @@ if(fixingSizeDisplay) setFixingSizeDisplay(v); if (treeProxy) { - if (hostName != null) { - if (direct) { - rootStart(args, new VncProxyService()); - return; - } else { - // send whereToConnect - v.startTreeViewer(hostName, cui, addSerialNum); - } + if (hostName != null && !direct) { + // send whereToConnect + v.startTreeViewer(hostName, cui, addSerialNum); } // this viewer also works as tree root ( display mode -d flag ) // start with no connection waiting server change request
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Sun Feb 02 19:58:17 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Feb 03 15:19:30 2020 +0900 @@ -523,12 +523,10 @@ GraphicsDevice[] gs = ge.getScreenDevices(); for (GraphicsDevice gd : gs) { - int screenNumber = 0; for (GraphicsConfiguration r : gd.getConfigurations()) { Rectangle rect = r.getBounds(); - //System.out.println("screen "+ screenNumber +":"+rect); + //System.out.println("screen "+ rectangles.length() +":"+rect); rectangles.add(rect); - screenNumber++; } } Point offset = getScreenOffset(rectangles); @@ -542,12 +540,7 @@ screenNumber++; } - fbRectangles.sort(new Comparator<FbRectangle>() { - @Override - public int compare(FbRectangle t0, FbRectangle t1) { - return t0.getX() < t1.getX() ? -1 : t0.getX() == t1.getX() ? 0 : 1; - } - }); + fbRectangles.sort((t0, t1) -> t0.getX() < t1.getX() ? -1 : t0.getX() == t1.getX() ? 0 : 1); int retinaOffsetX = 0; FbRectangle fbRectanglesPrev = fbRectangles.get(0); @@ -563,12 +556,7 @@ fbRectanglesPrev = fbRect; } - fbRectangles.sort(new Comparator<FbRectangle>() { - @Override - public int compare(FbRectangle t0, FbRectangle t1) { - return t0.getY() < t1.getY() ? -1 : t0.getY() == t1.getY() ? 0 : 1; - } - }); + fbRectangles.sort((t0, t1) -> t0.getY() < t1.getY() ? -1 : t0.getY() == t1.getY() ? 0 : 1); int retinaOffsetY = 0; fbRectanglesPrev = fbRectangles.get(0);