fixed issue and test svn

git-svn-id: http://tint2.googlecode.com/svn/trunk@14 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr
2008-10-30 15:39:24 +00:00
parent 420dd5d1e2
commit c9dc168587
13 changed files with 130 additions and 136 deletions

View File

@@ -66,6 +66,7 @@ void server_init_atoms ()
server.atom._WIN_LAYER = XInternAtom (server.dsp, "_WIN_LAYER", False);
server.atom._NET_WM_STRUT_PARTIAL = XInternAtom (server.dsp, "_NET_WM_STRUT_PARTIAL", False);
server.atom.WM_NAME = XInternAtom(server.dsp, "WM_NAME", False);
server.atom.__SWM_VROOT = XInternAtom(server.dsp, "__SWM_VROOT", False);
}
@@ -133,12 +134,49 @@ void *server_get_property (Window win, Atom at, Atom type, int *num_results)
}
Pixmap server_create_pixmap (int width, int height)
{
return XCreatePixmap (server.dsp, server.root_win, width, height, server.depth);
}
Pixmap get_root_pixmap ()
{
Pixmap ret;
Window root = RootWindow(server.dsp, server.screen);
ret = None;
int act_format, c = 2 ;
u_long nitems ;
u_long bytes_after ;
u_char *prop ;
Atom dummy_id;
do {
if (XGetWindowProperty(server.dsp, root, server.atom._XROOTPMAP_ID, 0, 1,
False, XA_PIXMAP, &dummy_id, &act_format,
&nitems, &bytes_after, &prop) == Success) {
if (prop) {
ret = *((Pixmap *)prop);
XFree(prop);
break;
}
}
} while (--c > 0);
return ret;
}
/*
Pixmap get_root_pixmap ()
{
// conky capture correctement le fond d'écran en xlib !!
Pixmap root_pixmap;
unsigned long *res;
server.root_win = window_get_root();
res = server_get_property (server.root_win, server.atom._XROOTPMAP_ID, XA_PIXMAP, 0);
if (res) {
root_pixmap = *((Drawable*) res);
@@ -149,18 +187,9 @@ Pixmap get_root_pixmap ()
printf("get_root_pixmap incorrect\n");
// try _XSETROOT_ID
}
return 0;
}
Pixmap server_create_pixmap (int width, int height)
{
return XCreatePixmap (server.dsp, server.root_win, width, height, server.depth);
}
}
*/
void server_refresh_root_pixmap ()
{