I use fedora 14 system. When I use starx startup desktop systems, I created a Xlib program, the code is as follows:
Atom wmStateAbove = XInternAtom(display, "_NET_WM_STATE_ABOVE",1);
if(wmStateAbove != None)
printf("_NET_WM_STATE_ABOVE has atom of %ld \n", (long)wmStateAbove);
else
printf("ERROR: can't find atom for _NET_WM_STATE_Above! \n");
Atom wmNetWmState = XInternAtom(display, "_NET_WM_STATE", 1);
if(wmNetWmState != None)
printf("_NET_WM_STATE has atom of %ld \n", (long)wmNetWmState);
else
printf("ERROR: can't find atom for _NET_WM_STATE! \n");
if(wmStateAbove != None)
{
printf("======\n");
XClientMessageEvent xclient;
memset(&xclient, 0, sizeof(xclient));
xclient.type = ClientMessage;
xclient.window = win;
xclient.message_type = wmNetWmState;
xclient.format = 32;
xclient.data.l[0] = 1;
xclient.data.l[1] = wmStateAbove;
xclient.data.l[2] = 1;
xclient.data.l[3] = 1;
xclient.data.l[4] = 0;
printf(" default Window %d \n", DefaultRootWindow(display));
XSendEvent(display,
DefaultRootWindow(display), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent*)&xclient);
The window can be created placed at the top But if I use xinit startup desktop systems, xinitrc script as follows,:
the program can't work normally, prompt _NET_WM_STATE and _NET_WM_STATE_ABOVE cannot find,the window can not be placed at the top, what's the reason?