home *** CD-ROM | disk | FTP | other *** search
- *** root.c.old Tue Sep 11 17:09:30 1990
- --- root.c Tue Sep 11 17:16:35 1990
- ***************
- *** 93,98 ****
- --- 93,109 ----
- }
- }
-
- + /*
- + * Modified to search for a virtual root window based on code from
- + * Tom LaStrange (toml@solbourne.com) in the tvtwm distribution.
- + * I doubt that I got all the other possible places changes are needed,
- + * especially w.r.t. colormaps.
- + *
- + * George Ferguson, ferguson@cs.rochester.edu, 11 Sep 1990.
- + */
- +
- + static Window getRootWindow();
- +
- void imageOnRoot(disp, scrn, image, verbose)
- Display *disp;
- int scrn;
- ***************
- *** 100,109 ****
- unsigned int verbose;
- { Pixmap pixmap;
- Colormap xcmap;
-
-
- ! freePrevious(disp, RootWindow(disp, scrn));
-
- if (! sendImageToX(disp, scrn, DefaultVisual(disp, scrn), image,
- &pixmap, &xcmap, verbose))
- exit(1);
- --- 111,123 ----
- unsigned int verbose;
- { Pixmap pixmap;
- Colormap xcmap;
- + Window root;
-
-
- ! root = getRootWindow(disp,scrn);
-
- + freePrevious(disp, root);
- +
- if (! sendImageToX(disp, scrn, DefaultVisual(disp, scrn), image,
- &pixmap, &xcmap, verbose))
- exit(1);
- ***************
- *** 117,124 ****
- exit(1);
- }
-
- ! XSetWindowBackgroundPixmap(disp, RootWindow(disp, scrn), pixmap);
- ! XClearWindow(disp, RootWindow(disp, scrn));
- XFreePixmap(disp, pixmap);
- ! preserveResource(disp, RootWindow(disp, scrn));
- }
- --- 131,167 ----
- exit(1);
- }
-
- ! XSetWindowBackgroundPixmap(disp, root, pixmap);
- ! XClearWindow(disp, root);
- XFreePixmap(disp, pixmap);
- ! preserveResource(disp, root);
- ! }
- !
- ! /*
- ! * This is more or less directly from ssetroot.c in the tvtwm distribution.
- ! */
- ! static Window
- ! getRootWindow(disp,scrn)
- ! Display *disp;
- ! int scrn;
- ! {
- ! Atom __SWM_VROOT,actual_type;
- ! Window root,rootReturn,parentReturn,*children,*newRoot;
- ! int numChildren,i,actual_format;
- ! long nitems, bytesafter;
- !
- !
- ! root = RootWindow(disp,scrn);
- ! __SWM_VROOT = XInternAtom(disp,"__SWM_VROOT",False);
- ! XQueryTree(disp,root,&rootReturn,&parentReturn,&children,&numChildren);
- ! for (i = 0; i < numChildren; i++) {
- ! newRoot = NULL;
- ! if (XGetWindowProperty (disp, children[i], __SWM_VROOT,0,1,
- ! False,XA_WINDOW,&actual_type,&actual_format,&nitems,&bytesafter,
- ! (unsigned char **)&newRoot) == Success && newRoot) {
- ! root = *newRoot;
- ! break;
- ! }
- ! }
- ! return(root);
- }
-