diff options
author | runge <runge> | 2007-02-19 03:08:12 +0000 |
---|---|---|
committer | runge <runge> | 2007-02-19 03:08:12 +0000 |
commit | d60e8ccfc8c1b173c914ffa26a88203690bf9e3a (patch) | |
tree | bc6e83b7e1a27c5b8a9c877fcd03f2bdfc68c6a8 /x11vnc/xevents.c | |
parent | a874ddee36c168750abe9a81eab481906e9f7365 (diff) | |
download | libtdevnc-d60e8ccfc8c1b173c914ffa26a88203690bf9e3a.tar.gz libtdevnc-d60e8ccfc8c1b173c914ffa26a88203690bf9e3a.zip |
x11vnc: Get ultravnc textchat working with ssvnc.
Diffstat (limited to 'x11vnc/xevents.c')
-rw-r--r-- | x11vnc/xevents.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/x11vnc/xevents.c b/x11vnc/xevents.c index bf1aa8d..f69588e 100644 --- a/x11vnc/xevents.c +++ b/x11vnc/xevents.c @@ -1374,25 +1374,41 @@ void set_server_input(rfbClientPtr cl, int grab) { } void set_text_chat(rfbClientPtr cl, int len, char *txt) { char buf[100]; + int dochat = 1; + rfbClientIteratorPtr iter; + rfbClientPtr cl2; - if (no_ultra_ext) { + if (no_ultra_ext || ! dochat) { return; } +#if 0 + rfbLog("set_text_chat: len=%d\n", len); rfbLog("set_text_chat: len=0x%x txt='", len); if (0 < len && len < 10000) write(2, txt, len); fprintf(stderr, "'\n"); +#endif if (unixpw_in_progress) { rfbLog("set_text_chat: unixpw_in_progress, skipping.\n"); return; } - if (0 && len == rfbTextChatOpen) { - if (rfbSendTextChatMessage(cl, rfbTextChatOpen, "")) { - rfbLog("rfbSendTextChatMessage: true\n"); - } else { - rfbLog("rfbSendTextChatMessage: false\n"); + iter = rfbGetClientIterator(screen); + while( (cl2 = rfbClientIteratorNext(iter)) ) { + if (cl2 == cl) { + continue; + } + if (len == rfbTextChatOpen) { + rfbSendTextChatMessage(cl2, rfbTextChatOpen, ""); + } else if (len == rfbTextChatClose) { + rfbSendTextChatMessage(cl2, rfbTextChatClose, ""); + } else if (len == rfbTextChatFinished) { + rfbSendTextChatMessage(cl2, rfbTextChatFinished, ""); + } else if (len <= rfbTextMaxSize) { + rfbSendTextChatMessage(cl2, len, txt); } } + rfbReleaseClientIterator(iter); } + int get_keyboard_led_state_hook(rfbScreenInfoPtr s) { if (unixpw_in_progress) { rfbLog("get_keyboard_led_state_hook: unixpw_in_progress, skipping.\n"); |