Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 450:aa3822daf75a
reintroduce retina code (send retina scaled screen size on Screen Change Request)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 19 Jun 2016 19:35:40 +0900 |
parents | d5bcae14c2cd |
children | 65ffb64cfb51 |
files | src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 2 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java Sun Jun 19 17:53:13 2016 +0900 +++ b/src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java Sun Jun 19 19:35:40 2016 +0900 @@ -46,6 +46,7 @@ this.width = width; this.height = height; this.sendFullScreenFlag = fullScreen; + System.out.println(this); // sendFullScreenRequest(); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Jun 19 17:53:13 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Jun 19 19:35:40 2016 +0900 @@ -928,13 +928,13 @@ showScreenInfo("request screen change",0, x,y,singleWidth,singleHeight,scale); if (viewer.getRfb().isTreeManager()) { - changeVncServer(viewer, x, y, singleWidth, singleHeight, scale, viewer.getRfb().getId()); + changeVncServer(viewer, x, y, singleWidth*scale, singleHeight*scale, scale, viewer.getRfb().getId()); } else if (viewer.getRfb().hasParent()) { String adr = viewer.getRfb().getMyAddress(); if (scanPort(adr, ConnectionParams.DEFAULT_RFB_PORT)) { // -1 means request to reverse direct connection socket short id = viewer.getRfb().isTreeManager()? (short)-1 : viewer.getRfb().getId(); - context.sendMessage(new ScreenChangeRequest(adr, ConnectionParams.DEFAULT_VNC_ROOT, id, x, y, singleWidth, singleHeight, scale)); + context.sendMessage(new ScreenChangeRequest(adr, ConnectionParams.DEFAULT_VNC_ROOT, id, x, y, singleWidth*scale, singleHeight*scale, scale)); } } } @@ -990,19 +990,21 @@ } int thisScreenWidth = (int) rectangles.get(thisScreenNumber).getWidth(); int thisScreenHeight = (int) rectangles.get(thisScreenNumber).getHeight(); - // int thisRetinaScale = retinaScale(thisScreenNumber); + int thisRetinaScale = retinaScale(thisScreenNumber); final int thatScreenX = presenter.getX(); final int thatScreenY = presenter.getY(); - // int thatRetinaScale = presenter.getRetinaScale(); + int thatRetinaScale = presenter.getRetinaScale(); final int thatScreenWidth = viewer.getRfb().getSingleWidth(); final int thatScreenHeight = viewer.getRfb().getSingleHeight(); - showScreenInfo("that", 0, thatScreenX, thatScreenY, thatScreenWidth, thatScreenHeight, 1); + showScreenInfo("that", 0, thatScreenX, thatScreenY, thatScreenWidth, thatScreenHeight, thatRetinaScale); + System.out.println("that FB x:" + presenter.getFrameSizeWidth() + " y:" + presenter.getFrameSizeHeight()); frame.setSize(thisScreenWidth, thisScreenHeight); double scale = uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, thatScreenWidth, thatScreenHeight); // final Rectangle visible = new Rectangle((int)(thatScreenX*scale),(int)(thatScreenY*scale),(int)(thatScreenWidth*scale)-1,(int)(thatScreenHeight*scale)-1); - showScreenInfo("this", thisScreenNumber, 0, 0,thisScreenWidth, thisScreenHeight, 1); + showScreenInfo("this", thisScreenNumber, 0, 0,thisScreenWidth, thisScreenHeight, thisRetinaScale); + System.out.println("this FB x:" + viewer.getConnectionPresenter().getFrameSizeWidth() + " y:" + viewer.getConnectionPresenter().getFrameSizeHeight()); System.out.println("thisScrollScale: " + scale); final int scrollx = (int)(thatScreenX * scale); final int scrolly = (thatScreenY!=0) ? (int)((thatScreenHeight - thatScreenY) * scale) : 0;