Path: utzoo!attcan!uunet!garfield!john13 From: john13@garfield.MUN.EDU (John Russell) Newsgroups: comp.sys.amiga.tech Subject: CloseScreen internals Keywords: closescreen 1.4 Message-ID: <4996@garfield.MUN.EDU> Date: 12 Nov 88 21:22:14 GMT Organization: CS Dept., Memorial U. of Newfoundland, St. John's Lines: 31 I'm curious as to whether the inner workings of CloseScreen could be changed for the better without breaking anything. I think they could. Why not make the screen structure's presence dependent on a semaphore? OpenScreen: initializes semaphore value to 0 OpenWindow: increments semaphore value of that screen unless WBenchWindow flag set (so Open/CloseWorkbench work) CloseWindow: decrements semaphore value; when all windows are closed semaphore reads 0 CloseScreen: decrements semaphore value; normally this is called after all windows are closed so value goes to -1 All functions that decremented the count would check, and if the count was -1 would actually close the screen and remove it from the system. The benefits? This would allow windows to open on any screen (maybe unbeknownst to the screen owner) and, if the owner attempted a CloseScreen it would succeed but not actually take the screen away until the remaining window(s) finally closed. Detriments? I can't think of any; this is similar to the way it's supposed to work now, except that it's the responsibility of the screen owner to close all his windows before closing the screen. The system should provide just that extra bit of security checking, thus opening up major opportunities for shared screens between applications. John -- "Families of Murder Victims bring Human Face to Court Proceedings" -- Gets my vote as most poorly-worded headline of the year