]> source.dussan.org Git - tigervnc.git/commitdiff
Send cursor pseudo-encodings in order of preference
authorPierre Ossman <ossman@cendio.se>
Wed, 16 Aug 2017 14:25:24 +0000 (16:25 +0200)
committerPierre Ossman <ossman@cendio.se>
Wed, 16 Aug 2017 14:25:24 +0000 (16:25 +0200)
Some servers respect the ordering of pseudo-encodings as well, so
make sure we list the best one first.

common/rfb/CMsgWriter.cxx
java/com/tigervnc/rfb/CMsgWriter.java

index 8576d8f1245750a740ff78910c203164a17cd985..fa784048086fef424c16c6680ac86f2913065df0 100644 (file)
@@ -72,9 +72,9 @@ void CMsgWriter::writeSetEncodings(int preferredEncoding, bool useCopyRect)
   rdr::U32 encodings[encodingMax+3];
 
   if (cp->supportsLocalCursor) {
-    encodings[nEncodings++] = pseudoEncodingXCursor;
-    encodings[nEncodings++] = pseudoEncodingCursor;
     encodings[nEncodings++] = pseudoEncodingCursorWithAlpha;
+    encodings[nEncodings++] = pseudoEncodingCursor;
+    encodings[nEncodings++] = pseudoEncodingXCursor;
   }
   if (cp->supportsDesktopResize)
     encodings[nEncodings++] = pseudoEncodingDesktopSize;
index d99f26cb6de1e851ed513e15c808a2bc645dd669..ea2b7c919e3da42a6c9ae2d9bf7040d291edf693 100644 (file)
@@ -65,10 +65,10 @@ public class CMsgWriter {
     int[] encodings = new int[Encodings.encodingMax+3];
 
     if (cp.supportsLocalCursor) {
-      encodings[nEncodings++] = Encodings.pseudoEncodingXCursor;
-      encodings[nEncodings++] = Encodings.pseudoEncodingCursor;
       if (cp.supportsLocalCursorWithAlpha)
         encodings[nEncodings++] = Encodings.pseudoEncodingCursorWithAlpha;
+      encodings[nEncodings++] = Encodings.pseudoEncodingCursor;
+      encodings[nEncodings++] = Encodings.pseudoEncodingXCursor;
     }
     if (cp.supportsDesktopResize)
       encodings[nEncodings++] = Encodings.pseudoEncodingDesktopSize;