summaryrefslogtreecommitdiffstats
path: root/x11vnc/solid.c
diff options
context:
space:
mode:
authorrunge <runge>2007-01-09 04:55:37 +0000
committerrunge <runge>2007-01-09 04:55:37 +0000
commitc9e24e5b8b9dd903a393f6b6e2176545fa2c93a8 (patch)
tree70fa77b47f34edf3091d6eb0b7a9c19f99a529d7 /x11vnc/solid.c
parent5b607a444900246dfcc8497da4d8ef1e41bedda6 (diff)
downloadlibtdevnc-c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8.tar.gz
libtdevnc-c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8.zip
more speed and accuracy improvements to -ncache mode.
Diffstat (limited to 'x11vnc/solid.c')
-rw-r--r--x11vnc/solid.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/x11vnc/solid.c b/x11vnc/solid.c
index be00264..e6cbf05 100644
--- a/x11vnc/solid.c
+++ b/x11vnc/solid.c
@@ -13,7 +13,7 @@ void solid_bg(int restore);
static void usr_bin_path(int restore);
static int dt_cmd(char *cmd);
static char *cmd_output(char *cmd);
-static void solid_root(char *color);
+XImage *solid_root(char *color);
static void solid_cde(char *color);
static void solid_gnome(char *color);
static void solid_kde(char *color);
@@ -113,11 +113,11 @@ static char *cmd_output(char *cmd) {
return(output);
}
-static void solid_root(char *color) {
+XImage *solid_root(char *color) {
#if NO_X11
RAWFB_RET_VOID
if (!color) {}
- return;
+ return NULL;
#else
Window expose;
static XImage *image = NULL;
@@ -130,11 +130,11 @@ static void solid_root(char *color) {
XColor cdef;
Colormap cmap;
- RAWFB_RET_VOID
+ RAWFB_RET(NULL)
if (subwin || window != rootwin) {
rfbLog("cannot set subwin to solid color, must be rootwin\n");
- return;
+ return NULL;
}
/* create the "clear" window just for generating exposures */
@@ -155,7 +155,7 @@ static void solid_root(char *color) {
/* whoops */
XDestroyWindow(dpy, expose);
rfbLog("no root snapshot available.\n");
- return;
+ return NULL;
}
@@ -180,7 +180,7 @@ static void solid_root(char *color) {
XMapWindow(dpy, expose);
XSync(dpy, False);
XDestroyWindow(dpy, expose);
- return;
+ return NULL;
}
if (! image) {
@@ -205,6 +205,13 @@ static void solid_root(char *color) {
ZPixmap);
XSync(dpy, False);
XDestroyWindow(dpy, iwin);
+ rfbLog("done.\n");
+ }
+ if (color == (char *) 0x1) {
+ /* caller will XDestroyImage it: */
+ XImage *xi = image;
+ image = NULL;
+ return xi;
}
/* use black for low colors or failure */
@@ -225,6 +232,7 @@ static void solid_root(char *color) {
XSync(dpy, False);
XDestroyWindow(dpy, expose);
#endif /* NO_X11 */
+ return NULL;
}
static void solid_cde(char *color) {