From 649f5b2b4615ae67d97eff7f3fa246a1ac41edf9 Mon Sep 17 00:00:00 2001 From: runge Date: Sun, 16 Dec 2007 18:37:22 +0000 Subject: x11vnc: setup remote-ctrl file by default on macosx. improve tkx11vnc wrt attaching to existing server in icon/tray mode. --- x11vnc/ChangeLog | 4 ++++ x11vnc/README | 6 +++--- x11vnc/cleanup.c | 2 +- x11vnc/gui.c | 10 ++++++++++ x11vnc/macosxCG.c | 4 ++-- x11vnc/remote.c | 1 + x11vnc/tkx11vnc | 25 +++++++++++++++++++------ x11vnc/tkx11vnc.h | 25 +++++++++++++++++++------ x11vnc/x11vnc.1 | 2 +- x11vnc/x11vnc.c | 42 +++++++++++++++++++++++++++--------------- x11vnc/x11vnc_defs.c | 2 +- 11 files changed, 88 insertions(+), 35 deletions(-) diff --git a/x11vnc/ChangeLog b/x11vnc/ChangeLog index a539267..4f91276 100644 --- a/x11vnc/ChangeLog +++ b/x11vnc/ChangeLog @@ -1,3 +1,7 @@ +2007-12-16 Karl Runge + * x11vnc: setup remote-ctrl file by default on macosx. improve + tkx11vnc wrt attaching to existing server in icon/tray mode. + 2007-12-15 Karl Runge * x11vnc: fix find_display and usleep() prototype on macosx. -display console and check DISPLAY /tmp/...:0 on macosx. diff --git a/x11vnc/README b/x11vnc/README index f45476c..ecf8780 100644 --- a/x11vnc/README +++ b/x11vnc/README @@ -1,5 +1,5 @@ -x11vnc README file Date: Sat Dec 15 19:10:20 EST 2007 +x11vnc README file Date: Sun Dec 16 13:21:20 EST 2007 The following information is taken from these URLs: @@ -11842,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-12-15 +x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-12-16 x11vnc options: -display disp -auth file -N @@ -11961,7 +11961,7 @@ libvncserver-tight-extension options: % x11vnc -help -x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-12-15 +x11vnc: allow VNC connections to real X11 displays. 0.9.4 lastmod: 2007-12-16 (type "x11vnc -opts" to just list the options.) diff --git a/x11vnc/cleanup.c b/x11vnc/cleanup.c index 65e763b..3422d35 100644 --- a/x11vnc/cleanup.c +++ b/x11vnc/cleanup.c @@ -140,7 +140,7 @@ void clean_up_exit (int ret) { #ifdef MACOSX if (client_connect_file) { - if (strstr(client_connect_file, "/tmp/x11vnc-macosx-channel.") + if (strstr(client_connect_file, "/tmp/x11vnc-macosx-remote") == client_connect_file) { unlink(client_connect_file); } diff --git a/x11vnc/gui.c b/x11vnc/gui.c index d6c9fd6..56975f9 100644 --- a/x11vnc/gui.c +++ b/x11vnc/gui.c @@ -152,6 +152,16 @@ int tray_embed(Window iconwin, int remove) { XChangeProperty(dpy, iconwin, xembed_info, xembed_info, 32, PropModeReplace, (unsigned char *)&info, 2); +#if 0 +{ +XSizeHints *xszh = XAllocSizeHints(); +xszh->flags = PMinSize; +xszh->min_width = 24; +xszh->min_height = 24; +XSetWMNormalHints(dpy, iconwin, xszh); +} +#endif + /* kludge for KDE evidently needed... */ tatom = XInternAtom(dpy, "KWM_DOCKWINDOW", False); XChangeProperty(dpy, iconwin, tatom, tatom, 32, PropModeReplace, diff --git a/x11vnc/macosxCG.c b/x11vnc/macosxCG.c index 8152aa3..bd11f6a 100644 --- a/x11vnc/macosxCG.c +++ b/x11vnc/macosxCG.c @@ -32,7 +32,7 @@ int macosxCG_get_cursor(void); void macosxCG_init_key_table(void); void macosxCG_key_inject(int down, unsigned int keysym); -CGDirectDisplayID displayID = NULL; +CGDirectDisplayID displayID = 0; extern void macosx_log(char *); extern int collect_non_X_xdamage(int x_in, int y_in, int w_in, int h_in, int call); @@ -100,7 +100,7 @@ extern void macosxCGP_screensaver_timer_off(void); extern void macosxCGP_screensaver_timer_on(void); void macosxCG_init(void) { - if (displayID == NULL) { + if (displayID == 0) { macosx_log("macosxCG_init: initializing display.\n"); #if 0 dragum(); diff --git a/x11vnc/remote.c b/x11vnc/remote.c index e01f08c..189eed9 100644 --- a/x11vnc/remote.c +++ b/x11vnc/remote.c @@ -52,6 +52,7 @@ int send_remote_cmd(char *cmd, int query, int wait) { FILE *in = NULL; if (client_connect_file) { + umask(077); in = fopen(client_connect_file, "w"); if (in == NULL) { fprintf(stderr, "send_remote_cmd: could not open " diff --git a/x11vnc/tkx11vnc b/x11vnc/tkx11vnc index 35984f7..3d4a49f 100755 --- a/x11vnc/tkx11vnc +++ b/x11vnc/tkx11vnc @@ -4860,7 +4860,7 @@ proc lmenu {menu} { } proc old_balloon {} { - global client_str saved_client_str + global client_str saved_clients_str set str "" if {[info exists client_str]} { if {$client_str != ""} { @@ -4868,8 +4868,8 @@ proc old_balloon {} { } } if {$str == ""} { - if {[info exists saved_client_str]} { - set str $saved_client_str + if {[info exists saved_clients_str]} { + set str $saved_clients_str } } if {$str != ""} { @@ -5029,6 +5029,7 @@ proc make_icon {} { } $menu add cascade -font $mfont -label "Window View:" -menu $wv + $menu add command -font $mfont -label "Dismiss" -command "$menu unpost" $menu add command -font $mfont -label "Stop x11vnc" -command clean_icon_exit set items [get_custom_menu_items] @@ -5047,10 +5048,11 @@ proc make_icon {} { bind $icon_win {set client_balloon_id [after 500 show_client_balloon]} bind $icon_win