diff options
author | runge <runge> | 2009-02-04 03:05:32 +0000 |
---|---|---|
committer | runge <runge> | 2009-02-04 03:05:32 +0000 |
commit | e59f78c5eaae3d7d0f98db064df0c85b1da1c7b9 (patch) | |
tree | 8ea60591ff85ae29c6134e04baedd8cf8373c60a /x11vnc/screen.c | |
parent | 3998c18e263b0c73af7451e2af2f40fb305520bf (diff) | |
download | libvncserver-e59f78c5eaae3d7d0f98db064df0c85b1da1c7b9.zip libvncserver-e59f78c5eaae3d7d0f98db064df0c85b1da1c7b9.tar.gz |
x11vnc: Add "sendbell" remote cmd. Fix copyrect updates under
-reflect. Workaround that checks valid window of selection
requestor. Wait on some ssl helper pids earlier. Workaround
XAUTHLOCALHOSTNAME for some new usage modes. Set fake fb to
requested bpp with correct masks. -padgeom once:... mode.
Set LIBXCB_ALLOW_SLOPPY_LOCK by default. rfbRandomBytes earlier.
classes/ssl: Update jars. Add "TOP_" dropdown customization to
ultravnc java viewer applet FTP panel.
Diffstat (limited to 'x11vnc/screen.c')
-rw-r--r-- | x11vnc/screen.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/x11vnc/screen.c b/x11vnc/screen.c index f66450a..27c435b 100644 --- a/x11vnc/screen.c +++ b/x11vnc/screen.c @@ -1004,6 +1004,48 @@ void vnc_reflect_got_cursorshape(rfbClient *cl, int xhot, int yhot, int width, i set_cursor(cursor_x, cursor_y, get_which_cursor()); } +static void from_libvncclient_CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) { + int i,j; + +#define COPY_RECT_FROM_RECT(BPP) \ + { \ + uint##BPP##_t* _buffer=((uint##BPP##_t*)client->frameBuffer)+(src_y-dest_y)*client->width+src_x-dest_x; \ + if (dest_y < src_y) { \ + for(j = dest_y*client->width; j < (dest_y+h)*client->width; j += client->width) { \ + if (dest_x < src_x) { \ + for(i = dest_x; i < dest_x+w; i++) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } else { \ + for(i = dest_x+w-1; i >= dest_x; i--) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } \ + } \ + } else { \ + for(j = (dest_y+h-1)*client->width; j >= dest_y*client->width; j-=client->width) { \ + if (dest_x < src_x) { \ + for(i = dest_x; i < dest_x+w; i++) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } else { \ + for(i = dest_x+w-1; i >= dest_x; i--) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } \ + } \ + } \ + } + + switch(client->format.bitsPerPixel) { + case 8: COPY_RECT_FROM_RECT(8); break; + case 16: COPY_RECT_FROM_RECT(16); break; + case 32: COPY_RECT_FROM_RECT(32); break; + default: + rfbClientLog("Unsupported bitsPerPixel: %d\n",client->format.bitsPerPixel); + } +} + void vnc_reflect_got_copyrect(rfbClient *cl, int src_x, int src_y, int w, int h, int dest_x, int dest_y) { sraRegionPtr reg; int dx, dy, rc = -1; @@ -1021,13 +1063,15 @@ void vnc_reflect_got_copyrect(rfbClient *cl, int src_x, int src_y, int w, int h, if (dx != last_dx || dy != last_dy) { rc = fb_push_wait(0.05, FB_COPY|FB_MOD); } - if (0) fprintf(stderr, "vnc_reflect_got_copyrect: %dx%d+%d+%d %d %d rc=%d\n", dest_x, dest_y, w, h, dx, dy, rc); + if (1) fprintf(stderr, "vnc_reflect_got_copyrect: %03dx%03d+%03d+%03d %3d %3d rc=%d\n", dest_x, dest_y, w, h, dx, dy, rc); reg = sraRgnCreateRect(dest_x, dest_y, dest_x + w, dest_y + h); do_copyregion(reg, dx, dy, 0); sraRgnDestroy(reg); last_dx = dx; last_dy = dy; + + from_libvncclient_CopyRectangleFromRectangle(cl, src_x, src_y, w, h, dest_x, dest_y); } rfbBool vnc_reflect_resize(rfbClient *cl) { |