*** /tmp/,RCSt1001672 Mon Jul 23 16:54:31 1990 --- savescreen.c Mon Jul 23 16:54:34 1990 *************** *** 17,23 **** */ #ifndef lint ! static char rcsid_savescreen_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/sipbsrc/rt_aos4/xscreensaver/RCS/savescreen.c,v 1.37 90/05/15 09:50:14 jik Exp $"; #endif #include "xsaver.h" --- 17,23 ---- */ #ifndef lint ! static char rcsid_savescreen_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/sipbsrc/rt_aos4/xscreensaver/RCS/savescreen.c,v 1.38 90/05/21 21:23:38 jik Exp $"; #endif #include "xsaver.h" *************** *** 51,56 **** --- 51,58 ---- : RaiseRoot()\n"; static XtTranslations lockedTrans = (XtTranslations) NULL; static Widget root_shell = (Widget) NULL; + static Widget *other_roots = NULL; /* for shells on other screens */ + static int num_others = 0; static XtIntervalId password_timeout; *************** *** 64,71 **** static void build_root() { ! Arg arglist[10]; ! int i = 0; Cursor cursor; char geometry[20]; --- 66,73 ---- static void build_root() { ! Arg arglist[15]; ! int i = 0, loop; Cursor cursor; char geometry[20]; *************** *** 101,106 **** --- 103,163 ---- /* the resources, so we are going to reposition the window after */ /* we create it. */ XtMoveWidget(root_shell, 0, 0); + + if (ScreenCount(dpy) > 1) { + other_roots = (Widget *) XtMalloc(sizeof(Widget) * + (ScreenCount(dpy) - 1)); + num_others = ScreenCount(dpy) - 1; + for (loop = 1; loop < ScreenCount(dpy); loop++) { + int w, h; + Widget wid; + Screen *screen; + int depth; + unsigned long black, white; + + w = DisplayWidth(dpy, loop); + h = DisplayHeight(dpy, loop); + screen = ScreenOfDisplay(dpy, loop); + depth = DefaultDepth(dpy, loop); + black = BlackPixel(dpy, loop); + white = WhitePixel(dpy, loop); + sprintf(geometry, "%dx%d+0+0", w, h); + XtSetArg(arglist[i], XtNborderWidth, 0); i++; + XtSetArg(arglist[i], XtNx, 0); i++; + XtSetArg(arglist[i], XtNy, 0); i++; + XtSetArg(arglist[i], XtNwidth, w); i++; + XtSetArg(arglist[i], XtNheight, h); i++; + XtSetArg(arglist[i], XtNgeometry, geometry); i++; + if (defs.use_background) { + XtSetArg(arglist[i], XtNbackgroundPixmap, + ParentRelative); i++; + } + /* settings necessary because of a toolkit bug */ + XtSetArg(arglist[i], XtNdepth, depth); i++; + XtSetArg(arglist[i], XtNbackground, black); i++; + XtSetArg(arglist[i], XtNborderColor, white); i++; + /* make sure the XtNscreen is last (see below)! */ + XtSetArg(arglist[i], XtNscreen, screen); i++; + other_roots[loop-1] = + XtCreatePopupShell("rootShell", + overrideShellWidgetClass, + top_widget, arglist, i); + /* + * Use i-1 instead of i here because we don't want + * to try to set the screen in a non-shell widget. + * Bad things might happen if we do. + */ + wid = XtCreateManagedWidget("root", widgetClass, + other_roots[loop-1], arglist, + i-1); i = 0; + + XtRealizeWidget(other_roots[loop-1]); + + XDefineCursor(dpy, XtWindow(other_roots[loop-1]), cursor); + XDefineCursor(dpy, XtWindow(wid), cursor); + XtMoveWidget(other_roots[loop-1], 0, 0); + } + } } } *************** *** 115,121 **** int ret; char buf[80]; XWMHints *hints; ! /* I'm using CurrentTime here where I shouldn't -- at some point */ /* in the future, the code should be fixed to move the map time */ /* of the root window. */ --- 172,179 ---- int ret; char buf[80]; XWMHints *hints; ! int i; ! /* I'm using CurrentTime here where I shouldn't -- at some point */ /* in the future, the code should be fixed to move the map time */ /* of the root window. */ *************** *** 130,135 **** --- 188,200 ---- saver.allow_exposures); XtMapWidget(root_shell); XRaiseWindow(dpy, XtWindow(root_shell)); + if (num_others) { + for (i = 0; i < num_others; i++) { + XtMapWidget(other_roots[i]); + XRaiseWindow(dpy, XtWindow(other_roots[i])); + } + } + /* Window must be mapped for some of the following calls to work, */ /* so we flush the display to make sure it gets mapped before */ /* these calls take place. */ *************** *** 510,515 **** --- 575,582 ---- String *params; Cardinal *num_params; { + int i; + is_locked = False; unlock_command(); DeactivateFloat(); *************** *** 519,524 **** --- 586,595 ---- root_shell, XtWindow(root_shell)); } XtUnmapWidget(root_shell); + if (num_others) { + for (i = 0; i < num_others; i ++) + XtUnmapWidget(other_roots[i]); + } XUngrabPointer(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime); if (defs.disable_x_screensaver)