summaryrefslogtreecommitdiffstats
path: root/x11vnc/x11vnc.c
diff options
context:
space:
mode:
authorrunge <runge>2007-02-10 21:52:26 +0000
committerrunge <runge>2007-02-10 21:52:26 +0000
commit90d96b971f04b11fe1902091a94be94697738766 (patch)
tree8331ed14521fd8e7b997465d6f482d521f4537cb /x11vnc/x11vnc.c
parent76720eb71bb18ec452ec1782af9f8b8d09e77efc (diff)
downloadlibtdevnc-90d96b971f04b11fe1902091a94be94697738766.tar.gz
libtdevnc-90d96b971f04b11fe1902091a94be94697738766.zip
x11vnc: watch textchat, etc in unixpw, implement kbdReleaseAllKeys, setSingleWindow, setServerInput. watch for OpenGL apps breaking XDAMAGE.
Diffstat (limited to 'x11vnc/x11vnc.c')
-rw-r--r--x11vnc/x11vnc.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/x11vnc/x11vnc.c b/x11vnc/x11vnc.c
index a45da20..ab44ef5 100644
--- a/x11vnc/x11vnc.c
+++ b/x11vnc/x11vnc.c
@@ -2345,7 +2345,7 @@ int main(int argc, char* argv[]) {
} else if (!strcmp(arg, "-dpms")) {
watch_dpms = 0;
} else if (!strcmp(arg, "-xdamage")) {
- use_xdamage = 1;
+ use_xdamage++;
} else if (!strcmp(arg, "-noxdamage")) {
use_xdamage = 0;
} else if (!strcmp(arg, "-xd_area")) {
@@ -3156,7 +3156,6 @@ int main(int argc, char* argv[]) {
dpy = XOpenDisplay_wr("");
}
-
#ifdef MACOSX
if (! dpy && ! raw_fb_str) {
raw_fb_str = strdup("console");
@@ -3207,6 +3206,7 @@ int main(int argc, char* argv[]) {
if (! quiet) rfbLog("Using default X display.\n");
}
+
scr = DefaultScreen(dpy);
rootwin = RootWindow(dpy, scr);
@@ -3646,6 +3646,68 @@ int main(int argc, char* argv[]) {
if (macosx_console) {
refresh_screen(1);
}
+ if (dpy && xdmcp_insert != NULL) {
+#if !NO_X11
+ char c;
+ int n = strlen(xdmcp_insert);
+ KeyCode k, k2;
+ KeySym sym;
+ int i, ok = 1;
+ for (i = 0; i < n; i++) {
+ c = xdmcp_insert[i];
+ sym = (KeySym) c;
+ if (sym < ' ' || sym > 0x7f) {
+ ok = 0;
+ break;
+ }
+ k = XKeysymToKeycode(dpy, sym);
+ if (k == NoSymbol) {
+ ok = 0;
+ break;
+ }
+ }
+ if (ok) {
+ XFlush_wr(dpy);
+ usleep(2*1000*1000);
+ if (!quiet) {
+ rfbLog("sending XDM '%s'\n", xdmcp_insert);
+ }
+ for (i = 0; i < n; i++) {
+ c = xdmcp_insert[i];
+ sym = (KeySym) c;
+ k = XKeysymToKeycode(dpy, sym);
+ if (isupper(c)) {
+ k2 = XKeysymToKeycode(dpy, XK_Shift_L);
+ XTestFakeKeyEvent_wr(dpy, k2, True, CurrentTime);
+ XFlush_wr(dpy);
+ usleep(100*1000);
+ }
+ if (0) fprintf(stderr, "C/k %c/%x\n", c, k);
+ XTestFakeKeyEvent_wr(dpy, k, True, CurrentTime);
+ XFlush_wr(dpy);
+ usleep(100*1000);
+ XTestFakeKeyEvent_wr(dpy, k, False, CurrentTime);
+ XFlush_wr(dpy);
+ usleep(100*1000);
+ if (isupper(c)) {
+ k2 = XKeysymToKeycode(dpy, XK_Shift_L);
+ XTestFakeKeyEvent_wr(dpy, k2, False, CurrentTime);
+ XFlush_wr(dpy);
+ usleep(100*1000);
+ }
+ }
+ k2 = XKeysymToKeycode(dpy, XK_Tab);
+ XTestFakeKeyEvent_wr(dpy, k2, True, CurrentTime);
+ XFlush_wr(dpy);
+ usleep(100*1000);
+ XTestFakeKeyEvent_wr(dpy, k2, False, CurrentTime);
+ XFlush_wr(dpy);
+ usleep(100*1000);
+ }
+ free(xdmcp_insert);
+#endif
+ }
+
}
if (! waited_for_client) {