author | Claus Gittinger <cg@exept.de> |
Tue, 14 May 2019 11:54:59 +0200 | |
changeset 4264 | 783af7121fea |
parent 4027 | 274bc7170ace |
permissions | -rw-r--r-- |
3847 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
12 |
"{ Package: 'stx:libview2' }" |
1371 | 13 |
|
3847 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
1371 | 16 |
EventListener subclass:#ScreenLock |
17 |
instanceVariableNames:'workstation lastInactiveTime lockAfterSeconds lockChannel |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
18 |
lockChannelOut processor lockedViews hiddenViews' |
1371 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'Interface-Support' |
|
22 |
! |
|
23 |
||
24 |
!ScreenLock class methodsFor:'documentation'! |
|
25 |
||
3847 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
1371 | 40 |
documentation |
41 |
" |
|
42 |
documentation to be added. |
|
43 |
||
44 |
[author:] |
|
45 |
Stefan Vogel (stefan@nilpferd) |
|
46 |
||
47 |
[see also:] |
|
48 |
||
49 |
[instance variables:] |
|
50 |
||
51 |
[class variables:] |
|
52 |
" |
|
53 |
! |
|
54 |
||
55 |
examples |
|
56 |
" |
|
57 |
[exBegin] |
|
58 |
|screenLock| |
|
59 |
||
60 |
screenLock := ScreenLock forDevice:Screen current. |
|
61 |
screenLock lock. |
|
62 |
Delay waitForSeconds:3. |
|
63 |
screenLock unlock. |
|
64 |
screenLock unlisten. |
|
65 |
[exEnd] |
|
66 |
||
67 |
[exBegin] |
|
68 |
|screenLock| |
|
69 |
||
70 |
screenLock := ScreenLock forDevice:Screen current. |
|
71 |
Delay waitForSeconds:1. |
|
72 |
screenLock checkTime. |
|
73 |
Delay waitForSeconds:12. |
|
74 |
screenLock checkTime. |
|
75 |
Delay waitForSeconds:3. |
|
76 |
screenLock unlock. |
|
77 |
screenLock unlisten. |
|
78 |
[exEnd] |
|
79 |
[exBegin] |
|
80 |
|screenLock channel running| |
|
81 |
||
82 |
screenLock := ScreenLock forDevice:Screen current. |
|
83 |
screenLock lockAfterSeconds:4. |
|
84 |
[ |
|
85 |
channel := false asValue. |
|
86 |
channel onChangeEvaluate:[ |
|
87 |
channel value ifTrue:[ |
|
88 |
self information:'Application is locked\\Hit ok to unlock' withCRs. |
|
89 |
channel value:false. |
|
90 |
]. |
|
91 |
]. |
|
92 |
screenLock lockChannel:channel. |
|
93 |
||
94 |
[ |
|
95 |
Delay waitForSeconds:2. |
|
96 |
screenLock checkTime. |
|
97 |
] loop. |
|
98 |
] valueNowOrOnUnwindDo:[ |
|
99 |
screenLock unlisten. |
|
100 |
]. |
|
101 |
[exEnd] |
|
102 |
" |
|
103 |
! ! |
|
104 |
||
105 |
!ScreenLock class methodsFor:'instance creation'! |
|
106 |
||
107 |
forDevice:aWorkstation |
|
108 |
||
109 |
^ self new initializeForDevice:aWorkstation |
|
110 |
||
111 |
! ! |
|
112 |
||
113 |
!ScreenLock methodsFor:'accessing'! |
|
114 |
||
115 |
lockAfterSeconds |
|
116 |
"return the value of the instance variable 'lockAfterSeconds' (automatically generated)" |
|
117 |
||
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
118 |
^ lockAfterSeconds |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
119 |
! |
1371 | 120 |
|
121 |
lockAfterSeconds:something |
|
122 |
"set the value of the instance variable 'lockAfterSeconds' (automatically generated)" |
|
123 |
||
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
124 |
lockAfterSeconds := something. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
125 |
! |
1371 | 126 |
|
4027 | 127 |
processor |
128 |
"return the value of the instance variable 'processor' (automatically generated)" |
|
129 |
||
130 |
^ processor |
|
131 |
! |
|
132 |
||
133 |
processor:something |
|
134 |
"set the value of the instance variable 'processor' (automatically generated)" |
|
135 |
||
136 |
processor := something. |
|
137 |
! |
|
138 |
||
139 |
workstation |
|
140 |
"return the value of the instance variable 'workstation' (automatically generated)" |
|
141 |
||
142 |
^ workstation |
|
143 |
! |
|
144 |
||
145 |
workstation:something |
|
146 |
"set the value of the instance variable 'workstation' (automatically generated)" |
|
147 |
||
148 |
workstation := something. |
|
149 |
! ! |
|
150 |
||
151 |
!ScreenLock methodsFor:'accessing-channels'! |
|
152 |
||
1371 | 153 |
lockChannel |
154 |
||
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
155 |
lockChannel isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
156 |
self lockChannel:false asValue. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
157 |
]. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
158 |
^ lockChannel |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
159 |
! |
1371 | 160 |
|
161 |
lockChannel:something |
|
162 |
||
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
163 |
lockChannel notNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
164 |
lockChannel removeDependent:self. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
165 |
]. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
166 |
|
1371 | 167 |
lockChannel := something. |
168 |
lockChannel addDependent:self. |
|
169 |
! |
|
170 |
||
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
171 |
lockChannelOut |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
172 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
173 |
lockChannelOut isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
174 |
lockChannelOut := false asValue. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
175 |
]. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
176 |
^ lockChannelOut |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
177 |
! |
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
178 |
|
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
179 |
lockChannelOut:something |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
180 |
"set the value of the instance variable 'lockChannelOut' (automatically generated)" |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
181 |
|
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
182 |
lockChannelOut := something. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
183 |
! ! |
1371 | 184 |
|
185 |
!ScreenLock methodsFor:'change & update'! |
|
186 |
||
187 |
update:aspect with:param from:anObject |
|
188 |
||
189 |
|lock| |
|
190 |
||
191 |
anObject == lockChannel ifTrue:[ |
|
192 |
aspect == #value ifTrue:[ |
|
193 |
"/ lockChannel is a value holder |
|
194 |
lock := lockChannel value. |
|
195 |
] ifFalse:[ |
|
196 |
"/ lockChannel is a block or something else |
|
197 |
lock := param. |
|
198 |
]. |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
199 |
|
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
200 |
"lock or unlock the screen |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
201 |
If a processor is defined, let the processor perform the unlock, |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
202 |
so that posssible Display errors do not affect the sender" |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
203 |
|
1371 | 204 |
lock == true ifTrue:[ |
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
205 |
processor isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
206 |
self lockScreen. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
207 |
] ifFalse:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
208 |
processor enqueueMessage:#lockScreen for:self arguments:#(). |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
209 |
]. |
1371 | 210 |
] ifFalse:[ |
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
211 |
processor isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
212 |
self unlockScreen. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
213 |
] ifFalse:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
214 |
processor enqueueMessage:#unlockScreen for:self arguments:#(). |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
215 |
]. |
1371 | 216 |
] |
217 |
]. |
|
218 |
! ! |
|
219 |
||
220 |
!ScreenLock methodsFor:'events'! |
|
221 |
||
222 |
buttonMotion:state x:x y:y view:aView |
|
223 |
||
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
224 |
^ self gotEventForView:aView. |
1371 | 225 |
! |
226 |
||
227 |
buttonMultiPress:button x:x y:y view:aView |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
228 |
^ self gotEventForView:aView. |
1371 | 229 |
|
230 |
! |
|
231 |
||
232 |
buttonPress:button x:x y:y view:aView |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
233 |
^ self gotEventForView:aView. |
1371 | 234 |
|
235 |
! |
|
236 |
||
237 |
buttonRelease:button x:x y:y view:aView |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
238 |
^ self gotEventForView:aView. |
1371 | 239 |
|
240 |
! |
|
241 |
||
242 |
keyPress:key x:x y:y view:aView |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
243 |
^ self gotEventForView:aView. |
1371 | 244 |
|
245 |
! |
|
246 |
||
247 |
keyRelease:key x:x y:y view:aView |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
248 |
^ self gotEventForView:aView. |
1371 | 249 |
|
250 |
! |
|
251 |
||
252 |
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
253 |
^ self gotEventForView:aView. |
1371 | 254 |
|
255 |
! ! |
|
256 |
||
257 |
!ScreenLock methodsFor:'lock interface'! |
|
258 |
||
259 |
checkTime |
|
260 |
||
261 |
|now| |
|
262 |
||
263 |
lockedViews isNil ifTrue:[ |
|
1966
b82e1cebf7af
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
1462
diff
changeset
|
264 |
now := Timestamp now. |
1371 | 265 |
lastInactiveTime notNil ifTrue:[ |
266 |
(lastInactiveTime addSeconds:lockAfterSeconds value) < now ifTrue:[ |
|
267 |
self lock |
|
268 |
]. |
|
269 |
] ifFalse:[ |
|
270 |
lastInactiveTime := now. |
|
271 |
]. |
|
272 |
]. |
|
273 |
! |
|
274 |
||
275 |
lock |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
276 |
"trigger locking of screen" |
1371 | 277 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
278 |
self lockChannel value:true. |
1371 | 279 |
! |
280 |
||
281 |
unlisten |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
282 |
"do not listen for events any longer. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
283 |
This must be called when a screen lock is detached from a |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
284 |
screen." |
1371 | 285 |
|
286 |
workstation removeEventListener:self |
|
287 |
! |
|
288 |
||
289 |
unlock |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
290 |
"trigger unlocking of screen" |
1371 | 291 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
292 |
self lockChannel value:false. |
1371 | 293 |
! ! |
294 |
||
295 |
!ScreenLock methodsFor:'private'! |
|
296 |
||
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
297 |
gotEventForView:v |
1371 | 298 |
"got an event. |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
299 |
Reset the inactive timer. |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
300 |
If locked, eat all user events (for security)" |
1371 | 301 |
|
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
302 |
lockedViews isNil ifTrue:[ |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
303 |
lastInactiveTime := nil. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
304 |
^ false. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
305 |
]. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
306 |
^ lockedViews includes:v. |
1371 | 307 |
! |
308 |
||
309 |
initializeForDevice:aWorkstation |
|
310 |
||
311 |
lockAfterSeconds := 10. |
|
312 |
workstation := aWorkstation. |
|
313 |
workstation addEventListener:self. |
|
314 |
||
315 |
! |
|
316 |
||
317 |
lockScreen |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
318 |
"lock the screen" |
1371 | 319 |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
320 |
lockedViews := workstation allViews. |
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
321 |
hiddenViews := lockedViews select:[:v| |
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
322 |
"close popupViews, they will leave the modal loop when |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
323 |
they are unmapped. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
324 |
This is a kludge, but invisible popUpViews are |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
325 |
currently not supported" |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
326 |
|
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
327 |
v isPopUpView ifTrue:[ |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
328 |
v hide. |
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
329 |
]. |
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
330 |
v shown and:[v isTopView]. |
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
331 |
]. |
1371 | 332 |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
333 |
hiddenViews do:[:v| |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
334 |
v beInvisible. |
1371 | 335 |
]. |
336 |
||
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
337 |
lockChannelOut notNil ifTrue:[ |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
338 |
lockChannelOut value:true. |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
339 |
]. |
1371 | 340 |
! |
341 |
||
342 |
unlockScreen |
|
343 |
||
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
344 |
lastInactiveTime := nil. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
345 |
hiddenViews do:[:v| |
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
346 |
"don't try to restore views that have been closed while |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
347 |
being invisible" |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
348 |
v id notNil ifTrue:[ |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
349 |
v beVisible. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
350 |
]. |
1371 | 351 |
]. |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
352 |
hiddenViews := lockedViews := nil. |
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
353 |
|
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
354 |
lockChannelOut notNil ifTrue:[ |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
355 |
lockChannelOut value:false. |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
356 |
]. |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
357 |
! ! |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
358 |
|
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
359 |
!ScreenLock methodsFor:'queries'! |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
360 |
|
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
361 |
isLocked |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
362 |
|
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
363 |
^ lockedViews notNil |
1371 | 364 |
! ! |
365 |
||
366 |
!ScreenLock class methodsFor:'documentation'! |
|
367 |
||
368 |
version |
|
3847 | 369 |
^ '$Header$' |
1371 | 370 |
! ! |
3847 | 371 |