# HG changeset patch # User Nozomi # Date 1465388318 -32400 # Node ID a80d190a9fc14fc33f666ca67b24aadbcbccd556 # Parent 7eaa95ca7e45387599137b819649cde79d5aae4c trying to fix fitScreen diff -r 7eaa95ca7e45 -r a80d190a9fc1 .idea/workspace.xml --- a/.idea/workspace.xml Wed Jun 08 20:54:07 2016 +0900 +++ b/.idea/workspace.xml Wed Jun 08 21:18:38 2016 +0900 @@ -2,14 +2,7 @@ - - - - - - - @@ -83,28 +76,23 @@ - - + + - - - - + + + + + + + + + - - - - - - - - - - @@ -923,6 +911,13 @@ @@ -965,6 +960,10 @@ + + + @@ -1035,7 +1034,7 @@ - + @@ -1043,13 +1042,18 @@ - - + + - - - - + + + + + + + + + diff -r 7eaa95ca7e45 -r a80d190a9fc1 src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java --- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Wed Jun 08 20:54:07 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Wed Jun 08 21:18:38 2016 +0900 @@ -881,9 +881,11 @@ @Override public void actionPerformed(ActionEvent e) { fitScreen(); + /* if (!viewer.getRfb().isTreeManager()) { context.sendMessage(new RequestSingleDisplaySize()); } + */ } }); @@ -1014,9 +1016,13 @@ int singleWidth = viewer.getRfb().getSingleWidth() * viewer.getRfb().getRetinaScale(); int singleHeight = viewer.getRfb().getSingleHeight() * viewer.getRfb().getRetinaScale(); frame.setSize(thisScreenWidth, thisScreenHeight); - Rectangle visible = new Rectangle(thatScreenX,thatScreenY,thisScreenWidth,thisScreenHeight); - scroller.scrollRectToVisible(visible); uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight); + final Rectangle visible = new Rectangle(thatScreenX,thatScreenY,thisScreenWidth,thisScreenHeight); + SwingUtilities.invokeLater(new Runnable(){ + public void run() { + scroller.scrollRectToVisible(visible); + } + }); } private void sendCtrlAltDel(ProtocolContext context) {