author | sr |
Thu, 26 Nov 2015 17:20:45 +0100 | |
changeset 3527 | aa939bace1e9 |
parent 1966 | b82e1cebf7af |
child 3847 | ac2486ce7d6f |
child 3855 | 1db7742d33ad |
permissions | -rw-r--r-- |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
1 |
"{ Package: 'stx:libview2' }" |
1371 | 2 |
|
3 |
EventListener subclass:#ScreenLock |
|
4 |
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
|
5 |
lockChannelOut processor lockedViews hiddenViews' |
1371 | 6 |
classVariableNames:'' |
7 |
poolDictionaries:'' |
|
8 |
category:'Interface-Support' |
|
9 |
! |
|
10 |
||
11 |
!ScreenLock class methodsFor:'documentation'! |
|
12 |
||
13 |
documentation |
|
14 |
" |
|
15 |
documentation to be added. |
|
16 |
||
17 |
[author:] |
|
18 |
Stefan Vogel (stefan@nilpferd) |
|
19 |
||
20 |
[see also:] |
|
21 |
||
22 |
[instance variables:] |
|
23 |
||
24 |
[class variables:] |
|
25 |
" |
|
26 |
! |
|
27 |
||
28 |
examples |
|
29 |
" |
|
30 |
[exBegin] |
|
31 |
|screenLock| |
|
32 |
||
33 |
screenLock := ScreenLock forDevice:Screen current. |
|
34 |
screenLock lock. |
|
35 |
Delay waitForSeconds:3. |
|
36 |
screenLock unlock. |
|
37 |
screenLock unlisten. |
|
38 |
[exEnd] |
|
39 |
||
40 |
[exBegin] |
|
41 |
|screenLock| |
|
42 |
||
43 |
screenLock := ScreenLock forDevice:Screen current. |
|
44 |
Delay waitForSeconds:1. |
|
45 |
screenLock checkTime. |
|
46 |
Delay waitForSeconds:12. |
|
47 |
screenLock checkTime. |
|
48 |
Delay waitForSeconds:3. |
|
49 |
screenLock unlock. |
|
50 |
screenLock unlisten. |
|
51 |
[exEnd] |
|
52 |
[exBegin] |
|
53 |
|screenLock channel running| |
|
54 |
||
55 |
screenLock := ScreenLock forDevice:Screen current. |
|
56 |
screenLock lockAfterSeconds:4. |
|
57 |
[ |
|
58 |
channel := false asValue. |
|
59 |
channel onChangeEvaluate:[ |
|
60 |
channel value ifTrue:[ |
|
61 |
self information:'Application is locked\\Hit ok to unlock' withCRs. |
|
62 |
channel value:false. |
|
63 |
]. |
|
64 |
]. |
|
65 |
screenLock lockChannel:channel. |
|
66 |
||
67 |
[ |
|
68 |
Delay waitForSeconds:2. |
|
69 |
screenLock checkTime. |
|
70 |
] loop. |
|
71 |
] valueNowOrOnUnwindDo:[ |
|
72 |
screenLock unlisten. |
|
73 |
]. |
|
74 |
[exEnd] |
|
75 |
" |
|
76 |
! ! |
|
77 |
||
78 |
!ScreenLock class methodsFor:'instance creation'! |
|
79 |
||
80 |
forDevice:aWorkstation |
|
81 |
||
82 |
^ self new initializeForDevice:aWorkstation |
|
83 |
||
84 |
! ! |
|
85 |
||
86 |
!ScreenLock methodsFor:'accessing'! |
|
87 |
||
88 |
lockAfterSeconds |
|
89 |
"return the value of the instance variable 'lockAfterSeconds' (automatically generated)" |
|
90 |
||
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
91 |
^ lockAfterSeconds |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
92 |
! |
1371 | 93 |
|
94 |
lockAfterSeconds:something |
|
95 |
"set the value of the instance variable 'lockAfterSeconds' (automatically generated)" |
|
96 |
||
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
97 |
lockAfterSeconds := something. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
98 |
! |
1371 | 99 |
|
100 |
lockChannel |
|
101 |
||
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
102 |
lockChannel isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
103 |
self lockChannel:false asValue. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
104 |
]. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
105 |
^ lockChannel |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
106 |
! |
1371 | 107 |
|
108 |
lockChannel:something |
|
109 |
||
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
110 |
lockChannel notNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
111 |
lockChannel removeDependent:self. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
112 |
]. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
113 |
|
1371 | 114 |
lockChannel := something. |
115 |
lockChannel addDependent:self. |
|
116 |
! |
|
117 |
||
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
118 |
lockChannelOut |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
119 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
120 |
lockChannelOut isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
121 |
lockChannelOut := false asValue. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
122 |
]. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
123 |
^ lockChannelOut |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
124 |
! |
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
125 |
|
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
126 |
lockChannelOut:something |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
127 |
"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
|
128 |
|
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
129 |
lockChannelOut := something. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
130 |
! |
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
131 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
132 |
processor |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
133 |
"return the value of the instance variable 'processor' (automatically generated)" |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
134 |
|
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
135 |
^ processor |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
136 |
! |
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
137 |
|
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
138 |
processor:something |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
139 |
"set the value of the instance variable 'processor' (automatically generated)" |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
140 |
|
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
141 |
processor := something. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
142 |
! |
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
143 |
|
1371 | 144 |
workstation |
145 |
"return the value of the instance variable 'workstation' (automatically generated)" |
|
146 |
||
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
147 |
^ workstation |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
148 |
! |
1371 | 149 |
|
150 |
workstation:something |
|
151 |
"set the value of the instance variable 'workstation' (automatically generated)" |
|
152 |
||
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
153 |
workstation := something. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
154 |
! ! |
1371 | 155 |
|
156 |
!ScreenLock methodsFor:'change & update'! |
|
157 |
||
158 |
update:aspect with:param from:anObject |
|
159 |
||
160 |
|lock| |
|
161 |
||
162 |
anObject == lockChannel ifTrue:[ |
|
163 |
aspect == #value ifTrue:[ |
|
164 |
"/ lockChannel is a value holder |
|
165 |
lock := lockChannel value. |
|
166 |
] ifFalse:[ |
|
167 |
"/ lockChannel is a block or something else |
|
168 |
lock := param. |
|
169 |
]. |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
170 |
|
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
171 |
"lock or unlock the screen |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
172 |
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
|
173 |
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
|
174 |
|
1371 | 175 |
lock == true ifTrue:[ |
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
176 |
processor isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
177 |
self lockScreen. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
178 |
] ifFalse:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
179 |
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
|
180 |
]. |
1371 | 181 |
] ifFalse:[ |
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
182 |
processor isNil ifTrue:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
183 |
self unlockScreen. |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
184 |
] ifFalse:[ |
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
185 |
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
|
186 |
]. |
1371 | 187 |
] |
188 |
]. |
|
189 |
! ! |
|
190 |
||
191 |
!ScreenLock methodsFor:'events'! |
|
192 |
||
193 |
buttonMotion:state x:x y:y view:aView |
|
194 |
||
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
195 |
^ self gotEventForView:aView. |
1371 | 196 |
! |
197 |
||
198 |
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
|
199 |
^ self gotEventForView:aView. |
1371 | 200 |
|
201 |
! |
|
202 |
||
203 |
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
|
204 |
^ self gotEventForView:aView. |
1371 | 205 |
|
206 |
! |
|
207 |
||
208 |
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
|
209 |
^ self gotEventForView:aView. |
1371 | 210 |
|
211 |
! |
|
212 |
||
213 |
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
|
214 |
^ self gotEventForView:aView. |
1371 | 215 |
|
216 |
! |
|
217 |
||
218 |
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
|
219 |
^ self gotEventForView:aView. |
1371 | 220 |
|
221 |
! |
|
222 |
||
223 |
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
|
224 |
^ self gotEventForView:aView. |
1371 | 225 |
|
226 |
! ! |
|
227 |
||
228 |
!ScreenLock methodsFor:'lock interface'! |
|
229 |
||
230 |
checkTime |
|
231 |
||
232 |
|now| |
|
233 |
||
234 |
lockedViews isNil ifTrue:[ |
|
1966
b82e1cebf7af
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
1462
diff
changeset
|
235 |
now := Timestamp now. |
1371 | 236 |
lastInactiveTime notNil ifTrue:[ |
237 |
(lastInactiveTime addSeconds:lockAfterSeconds value) < now ifTrue:[ |
|
238 |
self lock |
|
239 |
]. |
|
240 |
] ifFalse:[ |
|
241 |
lastInactiveTime := now. |
|
242 |
]. |
|
243 |
]. |
|
244 |
! |
|
245 |
||
246 |
lock |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
247 |
"trigger locking of screen" |
1371 | 248 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
249 |
self lockChannel value:true. |
1371 | 250 |
! |
251 |
||
252 |
unlisten |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
253 |
"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
|
254 |
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
|
255 |
screen." |
1371 | 256 |
|
257 |
workstation removeEventListener:self |
|
258 |
! |
|
259 |
||
260 |
unlock |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
261 |
"trigger unlocking of screen" |
1371 | 262 |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
263 |
self lockChannel value:false. |
1371 | 264 |
! ! |
265 |
||
266 |
!ScreenLock methodsFor:'private'! |
|
267 |
||
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
268 |
gotEventForView:v |
1371 | 269 |
"got an event. |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
270 |
Reset the inactive timer. |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
271 |
If locked, eat all user events (for security)" |
1371 | 272 |
|
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
273 |
lockedViews isNil ifTrue:[ |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
274 |
lastInactiveTime := nil. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
275 |
^ false. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
276 |
]. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
277 |
^ lockedViews includes:v. |
1371 | 278 |
! |
279 |
||
280 |
initializeForDevice:aWorkstation |
|
281 |
||
282 |
lockAfterSeconds := 10. |
|
283 |
workstation := aWorkstation. |
|
284 |
workstation addEventListener:self. |
|
285 |
||
286 |
! |
|
287 |
||
288 |
lockScreen |
|
1416
79f3aee2d64c
Add processor (an ApplicationModel), which processes the lock/unlock
Stefan Vogel <sv@exept.de>
parents:
1415
diff
changeset
|
289 |
"lock the screen" |
1371 | 290 |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
291 |
lockedViews := workstation allViews. |
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
292 |
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
|
293 |
"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
|
294 |
they are unmapped. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
295 |
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
|
296 |
currently not supported" |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
297 |
|
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
298 |
v isPopUpView ifTrue:[ |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
299 |
v hide. |
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
300 |
]. |
1462
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
301 |
v shown and:[v isTopView]. |
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
302 |
]. |
1371 | 303 |
|
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
304 |
hiddenViews do:[:v| |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
305 |
v beInvisible. |
1371 | 306 |
]. |
307 |
||
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
308 |
lockChannelOut notNil ifTrue:[ |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
309 |
lockChannelOut value:true. |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
310 |
]. |
1371 | 311 |
! |
312 |
||
313 |
unlockScreen |
|
314 |
||
1376
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
315 |
lastInactiveTime := nil. |
6294517bece4
Keep date of start of inactivity.
Stefan Vogel <sv@exept.de>
parents:
1374
diff
changeset
|
316 |
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
|
317 |
"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
|
318 |
being invisible" |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
319 |
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
|
320 |
v beVisible. |
b7ffa1109142
Do not restore views that have been closed whlie being invisible.
Stefan Vogel <sv@exept.de>
parents:
1416
diff
changeset
|
321 |
]. |
1371 | 322 |
]. |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
323 |
hiddenViews := lockedViews := nil. |
1415
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
324 |
|
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
325 |
lockChannelOut notNil ifTrue:[ |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
326 |
lockChannelOut value:false. |
fd8738cc4733
Use lockChannelOut to avoid races when locking/unlocking
Stefan Vogel <sv@exept.de>
parents:
1376
diff
changeset
|
327 |
]. |
1374
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
328 |
! ! |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
329 |
|
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
330 |
!ScreenLock methodsFor:'queries'! |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
331 |
|
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
332 |
isLocked |
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
333 |
|
881f1ba7ca1e
Eat all user generated events if locked.
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
334 |
^ lockedViews notNil |
1371 | 335 |
! ! |
336 |
||
337 |
!ScreenLock class methodsFor:'documentation'! |
|
338 |
||
339 |
version |
|
1966
b82e1cebf7af
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
1462
diff
changeset
|
340 |
^ '$Header: /cvs/stx/stx/libview2/ScreenLock.st,v 1.7 2004-03-20 19:20:31 stefan Exp $' |
1371 | 341 |
! ! |