summaryrefslogtreecommitdiffstats
path: root/x11vnc/util.c
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2009-12-02 22:09:51 -0500
committerrunge <runge@karlrunge.com>2009-12-02 22:09:51 -0500
commit00a9a0ea4d0f642b34b4423ea867099b52edf078 (patch)
treec9df2a624681358103c80e79847fd415cf3a8e2f /x11vnc/util.c
parentf40b0111827677625d81b7b7fcd001ce285adf69 (diff)
downloadlibtdevnc-00a9a0ea4d0f642b34b4423ea867099b52edf078.tar.gz
libtdevnc-00a9a0ea4d0f642b34b4423ea867099b52edf078.zip
x11vnc: -appshare mode for sharing an application windows instead of the
entire desktop. map port + 5500 in reverse connect. Add id_cmd remote control functions for id (and other) windows. Allow zero port in SSL reverse connections. Adjust delays between multiple reverse connections; X11VNC_REVERSE_SLEEP_MAX env var. Add some missing mutex locks; add INPUT_LOCK and threads_drop_input. More safety in -threads mode for new framebuffer change. Fix some stderr leaking in -inetd mode.
Diffstat (limited to 'x11vnc/util.c')
-rw-r--r--x11vnc/util.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/x11vnc/util.c b/x11vnc/util.c
index a00679a..5a733de 100644
--- a/x11vnc/util.c
+++ b/x11vnc/util.c
@@ -471,6 +471,7 @@ double rfac(void) {
void check_allinput_rate(void) {
static double last_all_input_check = 0.0;
static int set = 0, verb = -1;
+
if (use_threads) {
return;
}
@@ -703,7 +704,7 @@ double rect_overlap(int x1, int y1, int x2, int y2, int X1, int Y1,
char *choose_title(char *display) {
static char title[(MAXN+10)];
- memset(title, 0, MAXN+10);
+ memset(title, 0, sizeof(title));
strcpy(title, "x11vnc");
if (display == NULL) {
@@ -724,13 +725,33 @@ char *choose_title(char *display) {
if (subwin && dpy && valid_window(subwin, NULL, 0)) {
#if !NO_X11
char *name = NULL;
+ int do_appshare = getenv("X11VNC_APPSHARE_ACTIVE") ? 1 : 0;
+ if (0 && do_appshare) {
+ title[0] = '\0';
+ }
if (XFetchName(dpy, subwin, &name)) {
if (name) {
- strncat(title, " ", MAXN - strlen(title));
+ if (title[0] != '\0') {
+ strncat(title, " ", MAXN - strlen(title));
+ }
strncat(title, name, MAXN - strlen(title));
free(name);
}
}
+ if (do_appshare) {
+ Window c;
+ int x, y;
+ if (xtranslate(subwin, rootwin, 0, 0, &x, &y, &c, 1)) {
+ char tmp[32];
+ if (scaling) {
+ x *= scale_fac_x;
+ y *= scale_fac_y;
+ }
+ sprintf(tmp, " XY=%d,%d", x, y);
+ strncat(title, tmp, MAXN - strlen(title));
+ }
+ rfbLog("appshare title: %s\n", title);
+ }
#endif /* NO_X11 */
}
X_UNLOCK;