Mercurial > hg > Applications > TreeVNC
changeset 256:dfec8bc1eb8e
fix --retina option
author | oc |
---|---|
date | Tue, 18 Nov 2014 14:10:53 +0900 |
parents | a931be447973 |
children | 11b59b223222 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java |
diffstat | 6 files changed, 23 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Nov 18 12:19:15 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Nov 18 14:10:53 2014 +0900 @@ -226,15 +226,17 @@ this.firstTime = false; } - timer = new Timer(true); - timer.schedule(new TimerTask(){ - @Override - public void run() { -// context.setFbWidth(600); -// context.setFbHeight(600); - context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true)); - } - },0,100); + if(rfb.fixRetinaDisplay) { + timer = new Timer(true); + timer.schedule(new TimerTask() { + @Override + public void run() { + context.setFbWidth(1280); + context.setFbHeight(800); + context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true)); + } + }, 0, 100); + } } while (numberOfRectangles-- > 0) { @@ -242,7 +244,7 @@ rect.fill(reader); long time = System.currentTimeMillis(); - if(rfb.isTreeManager()) + if(rfb.isTreeManager() && rfb.checkDelay) System.out.println(time + " : size : " + rect.width * rect.height); Decoder decoder = decoders.getDecoderByType(rect.getEncodingType());
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Tue Nov 18 12:19:15 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Tue Nov 18 14:10:53 2014 +0900 @@ -67,6 +67,7 @@ public LinkedList<TreeVNCNode> nodeList; public boolean checkDelay = false; public boolean addSerialNum = false; + public boolean fixRetinaDisplay = false; public TreeRFBProto(boolean isTreeManager) { @@ -774,4 +775,7 @@ return nodeNum; } + public void setFixRetinaDisplay(boolean fixRetinaDisplay) { + this.fixRetinaDisplay = fixRetinaDisplay; + } } \ No newline at end of file
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Tue Nov 18 12:19:15 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Tue Nov 18 14:10:53 2014 +0900 @@ -259,7 +259,7 @@ } @Override - public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum) { + public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixRetinaDisplay) { }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Tue Nov 18 12:19:15 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Tue Nov 18 14:10:53 2014 +0900 @@ -14,6 +14,7 @@ private boolean showTree = false; private boolean checkDelay = false; private boolean addSerialNum = false; + private boolean fixRetinaDisplay = false; public static void main(String[] args) { new TreeViewer().vncStart(args); @@ -44,7 +45,7 @@ public void rootStart(String[] args, ViewerInterface v) { v.setNoConnection(noConnection); // should we accept host name here? - v.proxyStart(args,width,height, showTree, checkDelay, addSerialNum); + v.proxyStart(args,width,height, showTree, checkDelay, addSerialNum, fixRetinaDisplay); v.getRfb().setHasViewer(viewer); if (!permitChangeScreen ) v.getRfb().setPermitChangeScreen(false); v.getRfb().getAcceptThread().waitForShutdown(); @@ -83,6 +84,7 @@ // restrict display size. width = 1280; height = 800; + fixRetinaDisplay = true; } else if ("--width".equals(args[i])) { width = Integer.parseInt(args[i+1]); i++;
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Nov 18 12:19:15 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Nov 18 14:10:53 2014 +0900 @@ -363,7 +363,7 @@ run(); } - public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum) { + public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixRetinaDisplay) { fbWidth = width; this.showTree = showTree; // input into arguments Decision @@ -381,6 +381,7 @@ rfb.setShowTree(showTree); rfb.setCheckDelay(checkDelay); rfb.setAddSerialNum(addSerialNum); + rfb.setFixRetinaDisplay(fixRetinaDisplay); rfb.setViewer(this); rfb.setCuiVersion(false); rfb.setHasViewer(true); // this flag will be overwrited after this method. Do we have to set here?
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Tue Nov 18 12:19:15 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Tue Nov 18 14:10:53 2014 +0900 @@ -29,7 +29,7 @@ public void inhelitClients(ViewerInterface vncProxyService, String hostName); - public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum); + public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixRetinaDisplay); public void setNoConnection(boolean noConnection);