x11vnc: fix find_display and usleep() prototype on macosx.

-display console and check DISPLAY /tmp/...:0 on macosx.
implement -noxinerama.
pull/1/head
runge 17 years ago
parent 2689647d6c
commit 3d0bd73627

@ -1,3 +1,8 @@
2007-12-15 Karl Runge <runge@karlrunge.com>
* x11vnc: fix find_display and usleep() prototype on macosx.
-display console and check DISPLAY /tmp/...:0 on macosx.
implement -noxinerama.
2007-11-12 Karl Runge <runge@karlrunge.com>
* x11vnc: add clear_locks (Caps_Lock, etc) action. Fix
ssh tunnel on Darwin.

@ -1,5 +1,5 @@
x11vnc README file Date: Wed Nov 7 17:16:51 EST 2007
x11vnc README file Date: Sat Dec 15 19:10:20 EST 2007
The following information is taken from these URLs:
@ -4135,16 +4135,17 @@ x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg
You next connect to x11vnc with a VNC viewer, give your username and
password to the X login prompt to start your session.
Note: gdm seems to have an annoying setting that causes x11vnc (and
any other X clients) to be killed after the user logs in. Setting
Note: GDM: gdm seems to have an annoying setting that causes x11vnc
(and any other X clients) to be killed after the user logs in. Setting
KillInitClients=false in the [daemon] section of /etc/X11/gdm/gdm.conf
avoids this. Otherwise, just restart x11vnc and then reconnect your
viewer. Other display managers (kdm, etc) may also have a similar
problem.
Note: For dtlogin in addition to the above sort of trick (BTW, the
auth file should be in /var/dt), you'll also need to add something
like Dtlogin*grabServer:False to the Xconfig file
(or /etc/gdm/gdm.conf, etc.) avoids this. Otherwise, just restart
x11vnc and then reconnect your viewer. Other display managers (kdm,
etc) may also have a similar problem. One user reports having to alter
"gdm.conf-custom" as well.
Note: Solaris: For dtlogin in addition to the above sort of trick
(BTW, the auth file should be in /var/dt), you'll also need to add
something like Dtlogin*grabServer:False to the Xconfig file
(/etc/dt/config/Xconfig or /usr/dt/config/Xconfig on Solaris, see
[585]the example at the end of this FAQ). Then restart dtlogin, e.g.:
/etc/init.d/dtlogin stop; /etc/init.d/dtlogin start or reboot.
@ -4174,8 +4175,9 @@ x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg
watch out for.
Note: The above gdm setting of KillInitClients=false in
/etc/X11/gdm/gdm.conf for GDM is needed here as well. Other display
managers (KDM, etc) may also have a similar problem.
/etc/X11/gdm/gdm.conf (or /etc/gdm/gdm.conf, etc.) for GDM is needed
here as well. Other display managers (KDM, etc) may also have a
similar problem.
Note: The above Dtlogin*grabServer:False step for Solaris will be
needed for dtlogin here as well.
@ -4202,8 +4204,8 @@ x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg
/usr/local/bin/x11vnc -rfbauth /etc/x11vnc.passwd -forever -bg -o /var/log/x1
1vnc.log
And then add this line to /etc/X11/gdm/gdm.conf in the [daemon]
section:
And then add this line to /etc/X11/gdm/gdm.conf (or /etc/gdm/gdm.conf,
etc.) in the [daemon] section:
KillInitClients=false
Then restart: /usr/sbin/gdm-restart (or reboot). The
@ -8000,8 +8002,9 @@ or:
Q-124: Thanks for your program and for your help! Can I make a
donation?
Please do (any amount is appreciated) and thank you for your support!
Click on the PayPal button below for more info.
Please do (any amount is appreciated; only a handful of people have
donated anything) and thank you for your support! Click on the PayPal
button below for more info.
[PayPal]
@ -11839,7 +11842,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-11-07
x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-12-15
x11vnc options:
-display disp -auth file -N
@ -11958,7 +11961,7 @@ libvncserver-tight-extension options:
% x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-11-07
x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-12-15
(type "x11vnc -opts" to just list the options.)

@ -259,7 +259,7 @@ void clear_locks(void) {
#else
XModifierKeymap *map;
int i, j, k = 0;
unsigned int state;
unsigned int state = 0;
RAWFB_RET_VOID
@ -279,6 +279,7 @@ void clear_locks(void) {
#endif
{
state = mask_state();
/* this may contain non-locks too... */
rfbLog("state: 0x%x\n", state);
}
if (! state) {

@ -139,7 +139,11 @@ extern void do_new_fb(int);
extern int macosx_wait_for_switch, macosx_resize;
extern void macosxGCS_poll_pb(void);
#if 0
extern void usleep(unsigned long usec);
#else
extern int usleep(useconds_t usec);
#endif
extern unsigned int sleep(unsigned int seconds);
extern void clean_up_exit (int ret);

@ -135,7 +135,11 @@ int macosxCGS_find_index(int w) {
return -1;
}
#if 0
extern void usleep(unsigned long usec);
#else
extern int usleep(useconds_t usec);
#endif
int macosxCGS_follow_animation_win(int win, int idx, int grow) {
double t = dnow();
@ -496,7 +500,9 @@ void macosxGCS_initpb(void) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
pblock = [[NSLock alloc] init];
if (![NSPasteboard generalPasteboard]) {
macosx_log("macosxGCS_initpb: pasteboard inaccessible.\n");
macosx_log("macosxGCS_initpb: **PASTEBOARD INACCESSIBLE**.\n");
macosx_log("macosxGCS_initpb: Clipboard exchange will NOT work.\n");
macosx_log("macosxGCS_initpb: Start x11vnc *inside* Aqua for Clipboard.\n");
pbcnt = 0;
pbstr = [[NSString alloc] initWithString:@"\e<PASTEBOARD INACCESSIBLE>\e"];
}

@ -848,17 +848,29 @@ char find_display[] =
"# who(1) output column 2:\n"
"#gone=`last $user | grep 'gone.*no.logout' | awk '{print $2}' | grep '^:' | sed -e 's,/.*,,' | tr '\\n' '|'`\n"
"#gone=\"${gone}__quite_impossible__\"\n"
"#display=`who | grep \"^${user}[ ][ ]*:[0-9]\" | egrep -v \" ($gone)\\>\" | head -n 1 \\\n"
"#display=`who 2>/dev/null | grep \"^${user}[ ][ ]*:[0-9]\" | egrep -v \" ($gone)\\>\" | head -n 1 \\\n"
"# | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
"poss=\"\"\n"
"list=`who | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
"list=\"$list \"`w -h \"$user\" | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
"list=\"$list \"`who | grep \"^${user}[ ]\" | awk '{print $NF}' | grep '(:[0-9]' | sed -e 's/[()]//g'`\n"
"host=`hostname | sed -e 's/\\..*$//'`\n"
"list=`who 2>/dev/null | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
"list=\"$list \"`w -h \"$user\" 2>/dev/null | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
"list=\"$list \"`who 2>/dev/null | grep \"^${user}[ ]\" | awk '{print $NF}' | grep '(:[0-9]' | sed -e 's/[()]//g'`\n"
"host=`hostname 2>/dev/null | sed -e 's/\\..*$//'`\n"
"if [ \"X$X11VNC_FINDDISPLAY_SKIP_XAUTH\" = \"X\" ]; then\n"
" list=\"$list \"`xauth list | awk '{print $1}' | grep /unix | grep \"^${host}\" | sed -e 's/^.*:/:/' | sort -n | uniq`\n"
"fi\n"
"\n"
"if [ \"X$uname\" = \"XDarwin\" ]; then\n"
" if who 2>/dev/null | grep -i \"^${user}[ ][ ]*console[ ]\" > /dev/null; then\n"
" echo \"DISPLAY=console\"\n"
" if [ \"X$FIND_DISPLAY_ALL\" = \"X\" ]; then\n"
" if [ \"X$showxauth\" != \"X\" ]; then\n"
" echo \"\"\n"
" fi\n"
" exit 0\n"
" fi\n"
" fi\n"
"fi\n"
"\n"
"for p in $list\n"
"do\n"
" xa=`echo \"$p\" | awk -F, '{print $2}'`\n"

@ -1,8 +1,8 @@
.\" This file was automatically generated from x11vnc -help output.
.TH X11VNC "1" "November 2007" "x11vnc " "User Commands"
.TH X11VNC "1" "December 2007" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.9.4, lastmod: 2007-11-07
version: 0.9.4, lastmod: 2007-12-15
.SH SYNOPSIS
.B x11vnc
[OPTION]...

@ -2860,6 +2860,8 @@ int main(int argc, char* argv[]) {
blackout_str = strdup(argv[++i]);
} else if (!strcmp(arg, "-xinerama")) {
xinerama = 1;
} else if (!strcmp(arg, "-noxinerama")) {
xinerama = 0;
} else if (!strcmp(arg, "-xtrap")) {
xtrap_input = 1;
} else if (!strcmp(arg, "-xrandr")) {
@ -4106,8 +4108,20 @@ if (0) fprintf(stderr, "XA: %s\n", getenv("XAUTHORITY"));
}
}
#ifdef MACOSX
if (use_dpy && !strcmp(use_dpy, "console")) {
;
} else
#endif
if (use_dpy) {
dpy = XOpenDisplay_wr(use_dpy);
#ifdef MACOSX
} else if (!subwin && getenv("DISPLAY")
&& strstr(getenv("DISPLAY"), "/tmp/") ) {
/* e.g. /tmp/launch-XlspvM/:0 on leopard */
rfbLog("MacOSX: Ignoring $DISPLAY '%s'\n", getenv("DISPLAY"));
rfbLog("MacOSX: Use -display $DISPLAY to force it.\n");
#endif
} else if ( (use_dpy = getenv("DISPLAY")) ) {
dpy = XOpenDisplay_wr(use_dpy);
} else {

@ -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: 2007-11-07";
char lastmod[] = "0.9.4 lastmod: 2007-12-15";
/* X display info */

Loading…
Cancel
Save