Mercurial > hg > Applications > TreeVNC
changeset 500:6609174beafe
fix subencoding
author | oshiro |
---|---|
date | Sun, 17 Feb 2019 17:55:25 +0900 |
parents | 5455c62a3775 |
children | 57ee5c26e8eb |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 3 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Sat Feb 16 17:31:34 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Sun Feb 17 17:55:25 2019 +0900 @@ -72,9 +72,7 @@ offset += readPalette(bytes, offset, renderer, paletteSize); if (1 == subencoding) { // A solid tile consisting of a single colour renderer.fillRect(palette[0], tileX, tileY, tileWidth, tileHeight); - continue; - } - if (isRle) { + } else if (isRle) { if (0 == paletteSize) { // subencoding == 128 (or paletteSize == 0) - Plain RLE offset += decodePlainRle(bytes, offset, renderer, tileX, tileY, tileWidth, tileHeight); } else { @@ -88,7 +86,7 @@ offset += decodePacked(bytes, offset, renderer, paletteSize, tileX, tileY, tileWidth, tileHeight); } } - rfbProto.multicastPut(rect, bytes, prevoffset, offset, tileWidth, tileHeight); + if (rfbProto != null) rfbProto.multicastPut(rect, bytes, prevoffset, offset, tileWidth, tileHeight); prevoffset = offset; } }
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Sat Feb 16 17:31:34 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Sun Feb 17 17:55:25 2019 +0900 @@ -31,7 +31,7 @@ if (rect.getEncodingType() == EncodingType.ZRLE) { // ReadSendData convert ZRLE to ZRLEE // unzipped data in the bytes - byte[] bytes = new byte[rect.x * rect.y * renderer.getBytesPerPixel()]; + byte[] bytes = new byte[rect.width * rect.height * renderer.getBytesPerPixel()]; rfb.readSendData(dataLen, reader, bytes, rect); decoder.decode1(renderer, rect, bytes, 0, rfb); return;
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sat Feb 16 17:31:34 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Feb 17 17:55:25 2019 +0900 @@ -993,7 +993,7 @@ // find which screen we are on Point thisScreenLocation = frame.getLocation(); Point mouse = frame.getMousePosition(); - System.out.println("finding this screeen number " + thisScreenLocation + " mouse " + mouse + " on screen 0 " + rectangles.get(0)) ; + System.out.println("finding this screen number " + thisScreenLocation + " mouse " + mouse + " on screen 0 " + rectangles.get(0)) ; int thisScreenNumber = 0; for(Rectangle rect : rectangles) { if ( rect.contains(thisScreenLocation) ) return thisScreenNumber;