# HG changeset patch # User oc # Date 1416287453 -32400 # Node ID dfec8bc1eb8e2ea3dc624c73e12dc721d4018ad2 # Parent a931be447973b10e6917a15821044c046c6900f2 fix --retina option diff -r a931be447973 -r dfec8bc1eb8e src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java --- 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()); diff -r a931be447973 -r dfec8bc1eb8e src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java --- 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 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 diff -r a931be447973 -r dfec8bc1eb8e src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java --- 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) { } diff -r a931be447973 -r dfec8bc1eb8e src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java --- 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++; diff -r a931be447973 -r dfec8bc1eb8e src/viewer_swing/java/com/glavsoft/viewer/Viewer.java --- 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? diff -r a931be447973 -r dfec8bc1eb8e src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java --- 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);