@abide/bridge 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/macAlert.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @abide/bridge
|
|
2
2
|
|
|
3
|
+
## 0.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 625e836: an answered pairing question leaves the screen — the run loop turns once after the alert is closed, as nothing else turns it ([`28c3cf5`](https://github.com/briancray/abide/commit/28c3cf5efe4a450b23a56ddd50a04578741b3317))
|
|
8
|
+
|
|
3
9
|
## 0.7.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
package/src/macAlert.ts
CHANGED
|
@@ -16,6 +16,8 @@ const FIRST_BUTTON = 1000
|
|
|
16
16
|
const ACCESSORY = 1
|
|
17
17
|
// NSApplicationActivationPolicyProhibited: no app at all, once the question is answered.
|
|
18
18
|
const PROHIBITED = 2
|
|
19
|
+
// How long the run loop turns once the alert is answered: enough for the window server to take it away.
|
|
20
|
+
const SETTLE_SECONDS = 0.1
|
|
19
21
|
// The icon of an app with none of its own, in place of the folder a bare executable is drawn as.
|
|
20
22
|
const GENERIC_ICON =
|
|
21
23
|
'/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns'
|
|
@@ -152,6 +154,19 @@ export function macAlert(
|
|
|
152
154
|
// This process runs on, minding the bridge, and pumps no events from here: as an app in front
|
|
153
155
|
// it would read as not responding, so it closes the alert and is no app at all.
|
|
154
156
|
send(send(alert, 'window'), 'orderOut:', null)
|
|
157
|
+
// A window is taken off the screen only when the run loop next turns, and nothing turns it
|
|
158
|
+
// from here: one short turn, so the alert leaves rather than staying drawn and unanswered.
|
|
159
|
+
send(
|
|
160
|
+
send(classNamed('NSRunLoop'), 'currentRunLoop'),
|
|
161
|
+
'runUntilDate:',
|
|
162
|
+
sendTyped(
|
|
163
|
+
classNamed('NSDate'),
|
|
164
|
+
'dateWithTimeIntervalSinceNow:',
|
|
165
|
+
[FFIType.f64],
|
|
166
|
+
FFIType.ptr,
|
|
167
|
+
SETTLE_SECONDS,
|
|
168
|
+
) as Id,
|
|
169
|
+
)
|
|
155
170
|
sendTyped(
|
|
156
171
|
application,
|
|
157
172
|
'setActivationPolicy:',
|