]> source.dussan.org Git - tigervnc.git/commitdiff
Fully implement support for alpha cursor pseudo encoding.
authorBrian P. Hinz <bphinz@users.sf.net>
Sun, 13 Aug 2017 00:19:50 +0000 (20:19 -0400)
committerBrian P. Hinz <bphinz@users.sf.net>
Sun, 13 Aug 2017 00:24:05 +0000 (20:24 -0400)
Alpha cursors are not supported in java on Windows so disable
it in that case.  Ideally it would be nice to be able to test
whether or not the client OS supports it, but at the moment
MS Windows is the only one that I'm aware of that doesn't.

java/com/tigervnc/rfb/CMsgWriter.java
java/com/tigervnc/rfb/ConnParams.java
java/com/tigervnc/vncviewer/CConn.java
java/com/tigervnc/vncviewer/VncViewer.java

index 7838da346e3cf8797e525dc6e35a8d9838a8b29a..d99f26cb6de1e851ed513e15c808a2bc645dd669 100644 (file)
@@ -67,7 +67,8 @@ public class CMsgWriter {
     if (cp.supportsLocalCursor) {
       encodings[nEncodings++] = Encodings.pseudoEncodingXCursor;
       encodings[nEncodings++] = Encodings.pseudoEncodingCursor;
-      encodings[nEncodings++] = Encodings.pseudoEncodingCursorWithAlpha;
+      if (cp.supportsLocalCursorWithAlpha)
+        encodings[nEncodings++] = Encodings.pseudoEncodingCursorWithAlpha;
     }
     if (cp.supportsDesktopResize)
       encodings[nEncodings++] = Encodings.pseudoEncodingDesktopSize;
index fe52770fcfb3e08d4bb1c501252621f7dd7d52e0..ce3af718e5f67b5d63f646e09c1bc66900b0ccbf 100644 (file)
@@ -39,6 +39,7 @@ public class ConnParams {
     majorVersion = 0; minorVersion = 0;
     width = 0; height = 0; useCopyRect = false;
     supportsLocalCursor = false; supportsLocalXCursor = false;
+    supportsLocalCursorWithAlpha = false;
     supportsDesktopResize = false; supportsExtendedDesktopSize = false;
     supportsDesktopRename = false; supportsLastRect = false;
     supportsSetDesktopSize = false; supportsFence = false;
@@ -128,6 +129,7 @@ public class ConnParams {
   {
     useCopyRect = false;
     supportsLocalCursor = false;
+    supportsLocalCursorWithAlpha = false;
     supportsDesktopResize = false;
     supportsExtendedDesktopSize = false;
     supportsLocalXCursor = false;
@@ -151,6 +153,9 @@ public class ConnParams {
       case Encodings.pseudoEncodingXCursor:
         supportsLocalXCursor = true;
         break;
+      case Encodings.pseudoEncodingCursorWithAlpha:
+        supportsLocalCursorWithAlpha = true;
+        break;
       case Encodings.pseudoEncodingDesktopSize:
         supportsDesktopResize = true;
         break;
@@ -213,6 +218,7 @@ public class ConnParams {
 
   public boolean supportsLocalCursor;
   public boolean supportsLocalXCursor;
+  public boolean supportsLocalCursorWithAlpha;
   public boolean supportsDesktopResize;
   public boolean supportsExtendedDesktopSize;
   public boolean supportsDesktopRename;
index c53f8058fd60a4a6c003e461625130d32907bd1f..85bdcb6964a0bed2896da86565cfe52fa8dba4b9 100644 (file)
@@ -104,6 +104,11 @@ public class CConn extends CConnection implements
       currentEncoding = encNum;
 
     cp.supportsLocalCursor = true;
+    if (VncViewer.os.contains("windows"))
+      // JRE on Windows does not support alpha cursor
+      cp.supportsLocalCursorWithAlpha = false;
+    else
+      cp.supportsLocalCursorWithAlpha = true;
 
     cp.supportsDesktopResize = true;
     cp.supportsExtendedDesktopSize = true;
index cab1fc53f652a7f0fc83860eb0850b1c7d05b12c..d6a3930b688c6a8b731e4cdcae72fcfc77299339 100644 (file)
@@ -81,7 +81,7 @@ public class VncViewer extends javax.swing.JApplet
   public static final InputStream timestamp =
     VncViewer.class.getResourceAsStream("timestamp");
   public static final String os = 
-    System.getProperty("os.name").toLowerCase();
+    System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
   private static VncViewer applet;
 
   private String defaultServerName;