summaryrefslogtreecommitdiffstats
path: root/x11vnc/user.c
diff options
context:
space:
mode:
authorrunge <runge>2009-02-04 03:05:32 +0000
committerrunge <runge>2009-02-04 03:05:32 +0000
commite59f78c5eaae3d7d0f98db064df0c85b1da1c7b9 (patch)
tree8ea60591ff85ae29c6134e04baedd8cf8373c60a /x11vnc/user.c
parent3998c18e263b0c73af7451e2af2f40fb305520bf (diff)
downloadlibtdevnc-e59f78c5eaae3d7d0f98db064df0c85b1da1c7b9.tar.gz
libtdevnc-e59f78c5eaae3d7d0f98db064df0c85b1da1c7b9.zip
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/user.c')
-rw-r--r--x11vnc/user.c53
1 files changed, 48 insertions, 5 deletions
diff --git a/x11vnc/user.c b/x11vnc/user.c
index 04e2d8f..60aef52 100644
--- a/x11vnc/user.c
+++ b/x11vnc/user.c
@@ -13,6 +13,7 @@
#include "keyboard.h"
#include "cursor.h"
#include "remote.h"
+#include "sslhelper.h"
#include "avahi.h"
void check_switched_user(void);
@@ -590,6 +591,7 @@ static int guess_user_and_switch(char *str, int fb_mode) {
free(t);
continue;
}
+
if (switch_user(user, fb_mode)) {
rfbLog("switched to guessed user: %s\n", user);
free(t);
@@ -684,6 +686,8 @@ int switch_user(char *user, int fb_mode) {
user++;
}
+ ssl_helper_pid(0, -2); /* waitall */
+
if (strstr(user, "guess=") == user) {
return guess_user_and_switch(user, fb_mode);
}
@@ -1370,10 +1374,27 @@ static void setup_fake_fb(XImage* fb_image, int w, int h, int b) {
fb_image->bits_per_pixel = b;
fb_image->bytes_per_line = w*b/8;
fb_image->bitmap_unit = -1;
- fb_image->depth = 24;
- fb_image->red_mask = 0xff0000;
- fb_image->green_mask = 0x00ff00;
- fb_image->blue_mask = 0x0000ff;
+ if (b >= 24) {
+ fb_image->depth = 24;
+ fb_image->red_mask = 0xff0000;
+ fb_image->green_mask = 0x00ff00;
+ fb_image->blue_mask = 0x0000ff;
+ } else if (b >= 16) {
+ fb_image->depth = 16;
+ fb_image->red_mask = 0x003f;
+ fb_image->green_mask = 0x07c0;
+ fb_image->blue_mask = 0xf800;
+ } else if (b >= 2) {
+ fb_image->depth = 8;
+ fb_image->red_mask = 0x07;
+ fb_image->green_mask = 0x38;
+ fb_image->blue_mask = 0xc0;
+ } else {
+ fb_image->depth = 1;
+ fb_image->red_mask = 0x1;
+ fb_image->green_mask = 0x1;
+ fb_image->blue_mask = 0x1;
+ }
depth = fb_image->depth;
@@ -2574,7 +2595,7 @@ int wait_for_client(int *argc, char** argv, int http) {
/* ugh, here we go... */
XImage* fb_image;
int w = 640, h = 480, b = 32;
- int w0, h0, i, chg_raw_fb = 0;
+ int w0 = -1, h0 = -1, i, chg_raw_fb = 0;
char *str, *q, *cmd = NULL;
int db = 0, dt = 0;
char *create_cmd = NULL;
@@ -2618,10 +2639,32 @@ int wait_for_client(int *argc, char** argv, int http) {
w = w0;
h = h0;
rfbLog("wait_for_client set: w=%d h=%d\n", w, h);
+ } else {
+ w0 = -1;
+ h0 = -1;
}
*q = ':';
str = q;
}
+ if ((w0 == -1 || h0 == -1) && pad_geometry != NULL) {
+ int b0, del = 0;
+ char *s = pad_geometry;
+ if (strstr(s, "once:") == s) {
+ del = 1;
+ s += strlen("once:");
+ }
+ if (sscanf(s, "%dx%dx%d", &w0, &h0, &b0) == 3) {
+ w = nabs(w0);
+ h = nabs(h0);
+ b = nabs(b0);
+ } else if (sscanf(s, "%dx%d", &w0, &h0) == 2) {
+ w = nabs(w0);
+ h = nabs(h0);
+ }
+ if (del) {
+ pad_geometry = NULL;
+ }
+ }
/* str currently begins with a ':' */
if (strstr(str, ":cmd=") == str) {