# HG changeset patch # User oc # Date 1403513947 -32400 # Node ID 9c02b5a72bf985134a8263dcc15cd52f8f39f64e # Parent 96fcfe560edbe8934f65c53d8629cd3b34a05c53 fix root myAddress. diff -r 96fcfe560edb -r 9c02b5a72bf9 src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java Mon Jun 23 17:16:05 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java Mon Jun 23 17:59:07 2014 +0900 @@ -273,6 +273,7 @@ try { servSock = new ServerSocket(port); acceptPort = port; + myAddress = "127.0.0.1"; break; } catch (BindException e) { port++; diff -r 96fcfe560edb -r 9c02b5a72bf9 src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java --- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jun 23 17:16:05 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jun 23 17:59:07 2014 +0900 @@ -44,6 +44,8 @@ import java.awt.*; import java.awt.event.*; +import java.io.IOException; +import java.net.UnknownHostException; import java.util.LinkedList; import java.util.List; import java.util.concurrent.Executors; @@ -833,6 +835,14 @@ // before change server, data from previous server // should be stopped. viewer.setCuiVersion(true); + if (viewer.getRfb().isRoot()) { + try { + viewer.getRfb().changeVNCServer(viewer, "localhost", 1980, 1090, viewer.getRfb().getId()); + } catch (Exception e1) { + System.out.println("can't change server :" + e1.getMessage()); + } + return; + } String adr = viewer.getRfb().getMyAddress(); context.sendMessage(new ScreenChangeRequest(adr, viewer.getRfb().getId())); }