DIRECTORY Booting USING [CheckpointProc, RegisterProcs, RollbackProc], Buttons USING [ButtonProc, Create], ClassIncreek USING [ActionBody, GetAction, Increek, IncreekError, NewStdIncreek, SetAtLatest], Idle USING [Sleep], Process USING [Abort, Pause, Seconds, SecondsToTicks], Rope USING [ROPE], RuntimeError USING [UNCAUGHT], SystemVersion USING [machineType], UserProfile USING [Number], ViewerClasses USING [Viewer], ViewerOps USING [PaintEverything]; ViewerProcessesImpl: CEDAR MONITOR IMPORTS Booting, Buttons, ClassIncreek, Process, Idle, RuntimeError, SystemVersion, UserProfile, ViewerOps = BEGIN idleProcess: PROCESS _ NIL; AutoIdle: PROC = TRUSTED { ENABLE RuntimeError.UNCAUGHT => GOTO Punt; increek: ClassIncreek.Increek; action: ClassIncreek.ActionBody; idleTime: Process.Seconds _ 60 * UserProfile.Number["Viewers.AutoIdleTimeout", 20]; IF idleTime<=0 THEN RETURN; increek _ ClassIncreek.NewStdIncreek[]; DO -- forever ClassIncreek.SetAtLatest[increek]; Process.Pause[Process.SecondsToTicks[idleTime]]; action _ ClassIncreek.GetAction[increek, dontWait, ----, clicksAndMotion ! ClassIncreek.IncreekError => LOOP]; WITH a: action SELECT FROM timedOut => IdleProc[NIL]; ENDCASE; ENDLOOP; EXITS Punt => NULL; }; IdleOn: Booting.RollbackProc = { idleProcess _ FORK AutoIdle[]; RefreshIfNecessary[]; }; IdleOff: Booting.CheckpointProc = TRUSTED { Process.Abort[idleProcess]; JOIN idleProcess; idleProcess _ NIL; }; useIdleCrock: BOOL _ TRUE; -- can be set to FALSE to provoke the bug IdleProc: Buttons.ButtonProc = { Idle.Sleep[]; RefreshIfNecessary[]; }; RefreshIfNecessary: PROC = { IF useIdleCrock AND SystemVersion.machineType = dandelion THEN ViewerOps.PaintEverything[]; }; [] _ Buttons.Create[ info: [name: "Idle"], proc: IdleProc, fork: TRUE, documentation: "Hide desktop pending user login"]; Booting.RegisterProcs[c: IdleOff, r: IdleOn]; IdleOn[NIL]; END. ViewerProcessesImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Doug Wyatt, April 21, 1985 4:03:53 pm PST Russ Atkinson (RRA) June 19, 1985 2:07:31 pm PDT RRA: February 24, 1984 12:44:23 pm PST This crock is here to get around a bug that is probably in VM. If we do not repaint everything, trash gets left on the screen after Idle comes back. This is tied up with the special memory used for the terminal on DLions, and nowhere else. Luckily, the bug appears benign except for the screen trash. Κ»– "Mesa" style˜codešœ™Kšœ Οmœ1™šœ&™&Kšœ―™―—Kšœ˜—K˜—K˜šœ˜Kšœ,žœ˜1K˜2—K˜Kšœ5žœ˜:K˜Kšžœ˜—…—b -