DIRECTORY Buttons, Idle, Menus, SystemVersion, ViewerClasses, ViewerIdle, ViewerOps; ViewerIdleImpl: CEDAR MONITOR IMPORTS Buttons, Idle, SystemVersion, ViewerOps EXPORTS ViewerIdle = { GetIdleProc: PUBLIC ENTRY PROC RETURNS [proc: Buttons.ButtonProc, clientData: REF ANY] = {proc _ idleProc; clientData _ idleData}; SetIdleProc: PUBLIC ENTRY PROC [proc: Buttons.ButtonProc, clientData: REF ANY _ NIL] RETURNS [oldProc: Buttons.ButtonProc, oldClientData: REF ANY] = { oldProc _ idleProc; oldClientData _ idleData; idleProc _ proc; idleData _ clientData; }; idleProc: Buttons.ButtonProc _ CallSleep; idleData: REF ANY _ NIL; CallSleep: Buttons.ButtonProc = {Idle.Sleep[]}; IdleProc: PROC [parent: REF ANY, clientData: REF ANY _ NIL, mouseButton: Menus.MouseButton _ red, shift, control: BOOL _ FALSE] --Buttons.ButtonProc-- = { idleProc[ parent: parent, clientData: idleData, mouseButton: mouseButton, shift: shift, control: control]; RefreshIfNecessary[]; }; useIdleCrock: BOOL _ TRUE; -- can be set to FALSE to provoke the bug RefreshIfNecessary: PROC = { IF useIdleCrock AND SystemVersion.machineType = dandelion THEN ViewerOps.PaintEverything[]; }; idleViewer: ViewerClasses.Viewer; Start: PROC = { idleViewer _ Buttons.Create[info: [name: "Idle"], proc: IdleProc, fork: TRUE]; }; Start[]; }. ζViewerIdleImpl.Mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Spreitzer, June 7, 1985 4:32:27 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. Κ– "cedar" style˜Icode™Jšœ Οmœ1™šœ&™&Jšœ―™―—Jšœ˜—J˜—K˜K˜!K˜š œžœ˜KšœHžœ˜NK˜—K˜K˜K˜K˜——…—