Revisiting Lock Screen

Paul Dupuis paul at
Thu Mar 28 15:13:35 EDT 2024

In our app, we have a lot of handlers (internal APIs) that get called by 
other handlers and, as multiple developers are involved, knowing what is 
calling what takes some effort. To address the issue of screen locks, we 
adopted a coding standard as follows:

If a handler should lock the screen, we add the following code:

<start of handler>
put the lockScreen into tPreserveLockScreen
if tPreserveLockScreen is false then lock screen -- if the screen is not 
already locked by any calling handler, then lock the screen, else, the 
screen is already locked by the calling handler

... code of the handler ....

if tPreserveLockScreen is false then unlock screen -- if the screen was 
not locked by the calling handler, it was locked by this handler, so 
unlock it, else, expect that the calling handler should unlock it (or 
preserve it as appropriate)
<end of handler>

I know this doesn't address the specific issue raised in this thread, 
but I thought this model may be helpful to someone reading this thread.

More information about the use-livecode mailing list