diff options
Diffstat (limited to 'x11vnc/xevents.c')
-rw-r--r-- | x11vnc/xevents.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/x11vnc/xevents.c b/x11vnc/xevents.c index 002dd99..101bd32 100644 --- a/x11vnc/xevents.c +++ b/x11vnc/xevents.c @@ -792,6 +792,7 @@ void check_xevents(int reset) { static time_t last_time_sync = 0; time_t now = time(NULL); static double last_request = 0.0; + static double last_xrefresh = 0.0; XErrorHandler old_handler; if (unixpw_in_progress) return; @@ -836,6 +837,31 @@ void check_xevents(int reset) { } } + if (have_clients && xrefresh > 0.0 && dnow() > last_xrefresh + xrefresh) { + XSetWindowAttributes swa; + Visual visual; + Window xrf; + unsigned long mask; + + swa.override_redirect = True; + swa.backing_store = NotUseful; + swa.save_under = False; + swa.background_pixmap = None; + visual.visualid = CopyFromParent; + mask = (CWOverrideRedirect|CWBackingStore|CWSaveUnder|CWBackPixmap); + + xrf = XCreateWindow(dpy, window, coff_x, coff_y, dpy_x, dpy_y, 0, CopyFromParent, + InputOutput, &visual, mask, &swa); + if (xrf != None) { + if (0) fprintf(stderr, "XCreateWindow(%d, %d, %d, %d) 0x%lx\n", coff_x, coff_y, dpy_x, dpy_y, xrf); + XMapWindow(dpy, xrf); + XFlush_wr(dpy); + XDestroyWindow(dpy, xrf); + XFlush_wr(dpy); + } + last_xrefresh = dnow(); + } + if (now > last_call+1) { /* we only check these once a second or so. */ int n = 0; |