diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2012-04-05 02:23:58 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2012-04-05 02:23:58 +0000 |
commit | b3ea375488ddb5ca8f9e90f7be95a269571262ad (patch) | |
tree | c3db967c4a3b9ca390ceadda39e096c8db751dd7 /java/com | |
parent | 28aa3a810f56b89d90ae32e5e75101db133ff530 (diff) | |
download | tigervnc-b3ea375488ddb5ca8f9e90f7be95a269571262ad.tar.gz tigervnc-b3ea375488ddb5ca8f9e90f7be95a269571262ad.zip |
Prevent viewer from reconfiguring viewport on pixel format changes.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4881 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/tigervnc/rfb/PixelBuffer.java | 2 | ||||
-rw-r--r-- | java/com/tigervnc/vncviewer/CConn.java | 26 |
2 files changed, 17 insertions, 11 deletions
diff --git a/java/com/tigervnc/rfb/PixelBuffer.java b/java/com/tigervnc/rfb/PixelBuffer.java index 43713550..cca82860 100644 --- a/java/com/tigervnc/rfb/PixelBuffer.java +++ b/java/com/tigervnc/rfb/PixelBuffer.java @@ -45,7 +45,7 @@ public class PixelBuffer { int gmask = pf.greenMax << pf.greenShift; int bmask = pf.blueMax << pf.blueShift; cm = new DirectColorModel(8, rmask, gmask, bmask); - if (pf.depth == 8 && !pf.trueColour) + if (!pf.trueColour) cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]); break; case 16: diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java index 0f95c691..a87ddaea 100644 --- a/java/com/tigervnc/vncviewer/CConn.java +++ b/java/com/tigervnc/vncviewer/CConn.java @@ -1044,21 +1044,27 @@ public class CConn extends CConnection viewer.acceptBell.setParam(options.acceptBell.isSelected()); String scaleString = options.scalingFactor.getSelectedItem().toString(); + String oldScaleFactor = viewer.scalingFactor.getValue(); if (scaleString.equals("Auto")) { + if (!oldScaleFactor.equals(scaleString)) { viewer.scalingFactor.setParam("Auto"); - if (desktop != null) - reconfigureViewport(); + if (desktop != null) + reconfigureViewport(); + } } else if(scaleString.equals("Fixed Aspect Ratio")) { - viewer.scalingFactor.setParam("FixedRatio"); - if (desktop != null) - reconfigureViewport(); + if (!oldScaleFactor.equals("FixedRatio")) { + viewer.scalingFactor.setParam("FixedRatio"); + if (desktop != null) + reconfigureViewport(); + } } else { scaleString=scaleString.substring(0, scaleString.length()-1); - String oldScaleFactor = viewer.scalingFactor.getValue(); - viewer.scalingFactor.setParam(scaleString); - if ((desktop != null) && (!oldScaleFactor.equals("Auto") || - !oldScaleFactor.equals("FixedRatio"))) { - reconfigureViewport(); + if (!oldScaleFactor.equals(scaleString)) { + viewer.scalingFactor.setParam(scaleString); + if ((desktop != null) && (!oldScaleFactor.equals("Auto") || + !oldScaleFactor.equals("FixedRatio"))) { + reconfigureViewport(); + } } } |