]> source.dussan.org Git - tigervnc.git/commitdiff
CopyRectDecoder missing getAffectedRegion method in java viewer
authorBrian P. Hinz <bphinz@users.sf.net>
Thu, 25 May 2017 02:33:25 +0000 (22:33 -0400)
committerBrian P. Hinz <bphinz@users.sf.net>
Thu, 25 May 2017 02:35:53 +0000 (22:35 -0400)
java/com/tigervnc/rfb/CopyRectDecoder.java

index a4298fd5f5199c583688f6ec5d0dbc4232c5dc58..40452e21a9bffa3a8f7e2daf97ff2cc121c3f7ee 100644 (file)
@@ -31,6 +31,20 @@ public class CopyRectDecoder extends Decoder {
     os.copyBytes(is, 4);
   }
 
+  public void getAffectedRegion(Rect rect, Object buffer,
+                                int buflen, ConnParams cp,
+                                Region region)
+  {
+    MemInStream is = new MemInStream((byte[])buffer, 0, buflen);
+    int srcX = is.readU16();
+    int srcY = is.readU16();
+
+    super.getAffectedRegion(rect, buffer, buflen, cp, region);
+
+    region.assign_union(new Region(rect.translate(new Point(srcX-rect.tl.x,
+                                                            srcY-rect.tl.y))));
+  }
+
   public void decodeRect(Rect r, Object buffer,
                          int buflen, ConnParams cp,
                          ModifiablePixelBuffer pb)