Mercurial > hg > Applications > TreeVNC
changeset 614:cab01ab88422
fix blocking
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 Feb 2020 01:54:33 +0900 |
parents | 994a710100fd |
children | e7d48fb40262 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Fri Feb 21 18:20:36 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Sat Feb 22 01:54:33 2020 +0900 @@ -101,6 +101,7 @@ deflater.deflate(c1); flushMuticast(rfb, bytes); } + System.out.println("blocking "+rect); return; } @@ -208,13 +209,13 @@ boolean end = flushDeflator(false," end of phase 0 "); width = 0; flushRectangle(c1rect,c1.position()); - if (end) { + c1rect = new FramebufferUpdateRectangle(rect.x,c1rect.y+tileH,0,0); + if (end || c1rect.y + tileY >= rect.y+rect.height) { flushMuticast(rfb,bytes); return; } c1.position(c1.position()+ RECT_HEADER_SIZE); // header space prevC1Offset = c1.position(); - c1rect = new FramebufferUpdateRectangle(rect.x,c1rect.y+tileH,0,0); } } else { // phase 1 if (width >= rect.width) { // next line @@ -227,7 +228,7 @@ c0rect = c1rect; } c1rect = new FramebufferUpdateRectangle(rect.x, c0rect.y+c0rect.height, 0, 0); - if (end) { + if (end || c1rect.y + tileY >= rect.y+rect.height) { c0rect = null; // next will be first phase 1 case flushMuticast(rfb,bytes); return; @@ -279,6 +280,8 @@ private void flushRectangle(FramebufferUpdateRectangle rect,int pos) { if (rect.width==0) return; System.out.println("sending broadcast" + rect); + if (rect.y >= this.rect.y+this.rect.height) + System.out.println("over y broadcast" + this.rect); c1.putShort(prevC1Offset - 16, (short) rect.x); c1.putShort(prevC1Offset - 14, (short) rect.y); c1.putShort(prevC1Offset - 12, (short) rect.width);