Commit 975b6902 authored by runge's avatar runge

x11vnc: -clip xineramaN option, -DIGNORE_GETSPNAM for HP-UX.

          Print info on SSH_CONNECTION override.
parent a824cf44
2008-06-07 Karl Runge <runge@karlrunge.com>
* x11vnc: -clip xineramaN option, -DIGNORE_GETSPNAM for HP-UX.
Print info on SSH_CONNECTION override.
2008-05-31 Karl Runge <runge@karlrunge.com>
* x11vnc: Improvements to nonstandard indexed color support, e.g.
depths 1, 4, 12, etc. instead of only 8. Only enable xinerama
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -128,6 +128,13 @@ void print_help(int mode) {
" into two parts to be accessed via separate viewers by\n"
" running a separate x11vnc on each part.\n"
"\n"
" Use '-clip xinerama0' to clip to the first xinerama\n"
" sub-screen (if xinerama is active). xinerama1 for the\n"
" 2nd sub-screen, etc. This way you don't need to figure\n"
" out the WxH+X+Y of the desired xinerama sub-screen.\n"
" screens are sorted in increasing distance from the\n"
" (0,0) origin (I.e. not the Xserver's order).\n"
"\n"
"-flashcmap In 8bpp indexed color, let the installed colormap flash\n"
" as the pointer moves from window to window (slow).\n"
" Also try the -8to24 option to avoid flash altogether.\n"
......
......@@ -25,6 +25,11 @@ extern char *crypt(const char*, const char *);
#endif
#endif
#ifdef IGNORE_GETSPNAM
#undef LIBVNCSERVER_HAVE_GETSPNAM
#define LIBVNCSERVER_HAVE_GETSPNAM 0
#endif
#if LIBVNCSERVER_HAVE_PWD_H && LIBVNCSERVER_HAVE_GETPWNAM
#if LIBVNCSERVER_HAVE_CRYPT || LIBVNCSERVER_HAVE_LIBCRYPT
#define UNIXPW_CRYPT
......
......@@ -2,7 +2,7 @@
.TH X11VNC "1" "June 2008" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.9.4, lastmod: 2008-06-01
version: 0.9.4, lastmod: 2008-06-06
.SH SYNOPSIS
.B x11vnc
[OPTION]...
......@@ -139,6 +139,13 @@ corner of the selected window. An example use of this
option would be to split a large (e.g. Xinerama) display
into two parts to be accessed via separate viewers by
running a separate x11vnc on each part.
.IP
Use '-clip xinerama0' to clip to the first xinerama
sub-screen (if xinerama is active). xinerama1 for the
2nd sub-screen, etc. This way you don't need to figure
out the WxH+X+Y of the desired xinerama sub-screen.
screens are sorted in increasing distance from the
(0,0) origin (I.e. not the Xserver's order).
.PP
\fB-flashcmap\fR
.IP
......
......@@ -3857,11 +3857,14 @@ int main(int argc, char* argv[]) {
if (! s) s = "SSH_CONNECTION";
fprintf(stderr, "\n");
rfbLog("Skipping -ssl/-stunnel constraint in"
" -unixpw\n");
rfbLog("mode, assuming your SSH encryption"
" is: %s\n", s);
" -unixpw mode,\n");
rfbLog("assuming your SSH encryption"
" is:\n");
rfbLog(" %s\n", s);
rfbLog("Setting -localhost in SSH + -unixpw"
" mode.\n");
rfbLog("If you *actually* want SSL, restart"
" with -ssl on the cmdline\n");
fprintf(stderr, "\n");
allow_list = strdup("127.0.0.1");
got_localhost = 1;
......@@ -4229,6 +4232,9 @@ if (0) fprintf(stderr, "XA: %s\n", getenv("XAUTHORITY"));
if (! quiet) rfbLog("Using default X display.\n");
}
if (clip_str != NULL && dpy != NULL) {
check_xinerama_clip();
}
scr = DefaultScreen(dpy);
rootwin = RootWindow(dpy, scr);
......
......@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.4 lastmod: 2008-06-01";
char lastmod[] = "0.9.4 lastmod: 2008-06-06";
/* X display info */
......
......@@ -227,6 +227,76 @@ static void blackout_tiles(void) {
}
}
static int did_xinerama_clip = 0;
void check_xinerama_clip(void) {
#if LIBVNCSERVER_HAVE_LIBXINERAMA
int n, k, i, ev, er, juse = -1;
int score[32], is = 0;
XineramaScreenInfo *x;
if (!clip_str || !dpy) {
return;
}
if (sscanf(clip_str, "xinerama%d", &k) == 1) {
;
} else if (sscanf(clip_str, "screen%d", &k) == 1) {
;
} else {
return;
}
free(clip_str);
clip_str = NULL;
if (! XineramaQueryExtension(dpy, &ev, &er)) {
return;
}
if (! XineramaIsActive(dpy)) {
return;
}
x = XineramaQueryScreens(dpy, &n);
if (k < 0 || k >= n) {
XFree_wr(x);
return;
}
for (i=0; i < n; i++) {
score[is++] = nabs(x[i].x_org) + nabs(x[i].y_org);
if (is >= 32) {
break;
}
}
for (i=0; i <= k; i++) {
int j, jmon, mon = -1, mox = -1;
for (j=0; j < is; j++) {
if (mon < 0 || score[j] < mon) {
mon = score[j];
jmon = j;
}
if (mox < 0 || score[j] > mox) {
mox = score[j];
}
}
juse = jmon;
score[juse] = mox+1+i;
}
if (juse >= 0 && juse < n) {
char str[64];
sprintf(str, "%dx%d+%d+%d", x[juse].width, x[juse].height,
x[juse].x_org, x[juse].y_org);
clip_str = strdup(str);
did_xinerama_clip = 1;
} else {
clip_str = strdup("");
}
XFree_wr(x);
if (!quiet) {
rfbLog("set -clip to '%s' for xinerama%d\n", clip_str, k);
}
#endif
}
static void initialize_xinerama (void) {
#if !LIBVNCSERVER_HAVE_LIBXINERAMA
rfbLog("Xinerama: Library libXinerama is not available to determine\n");
......@@ -305,6 +375,7 @@ static void initialize_xinerama (void) {
}
XFree_wr(xineramas);
if (sraRgnEmpty(black_region)) {
rfbLog("Xinerama: no blackouts needed (screen fills"
" rectangle)\n");
......@@ -312,6 +383,10 @@ static void initialize_xinerama (void) {
sraRgnDestroy(black_region);
return;
}
if (did_xinerama_clip) {
rfbLog("Xinerama: no blackouts due to -clip xinerama.\n");
return;
}
/* max len is 10000x10000+10000+10000 (23 chars) per geometry */
rcnt = (int) sraRgnCountRects(black_region);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment