aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/com/tigervnc/rfb/PixelBuffer.java2
-rw-r--r--java/com/tigervnc/vncviewer/CConn.java26
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();
+ }
}
}