@windowkit/appkit 0.14.0 → 0.14.1
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/README.md
CHANGED
|
@@ -222,6 +222,13 @@ nothing. While `runMain` runs, `listScreens`, `accessibilityDisplayOptions` and
|
|
|
222
222
|
`pasteboardChangeCount` answer from it when called off the main thread. On the main
|
|
223
223
|
thread they still ask AppKit live, as in pump mode.
|
|
224
224
|
|
|
225
|
+
A copy that changes with no event after it is a renderer left waiting, so `showWindow`
|
|
226
|
+
sends `window-shown { handle }` once the window is on screen and published. AppKit's own
|
|
227
|
+
notifications usually say as much, since the window moves as it is ordered in, but a
|
|
228
|
+
window taller than its screen is constrained, resized and moved before it is visible, and
|
|
229
|
+
nothing after that says it is shown. A worker that holds the frames of a window it cannot
|
|
230
|
+
see waited on that window for good.
|
|
231
|
+
|
|
225
232
|
**Exit and signals.** Before the run stops, menu tracking is cancelled and an app-modal
|
|
226
233
|
loop stopped, since `[NSApp stop:]` only ends the innermost loop. A drag session or a live
|
|
227
234
|
resize cannot be ended from code, so the exit waits for the button to come up. While the run lasts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windowkit/appkit",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Retained-mode AppKit backend for Node.js: Core Animation (CALayer) layer trees, CoreText layout and drawing, IOSurface presentation, NSMenu, and native control bezels — the macOS half of react-x11.",
|
|
5
5
|
"author": "Andrey Sidorov <andrey.sidorov@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
Binary file
|
|
Binary file
|
package/src/backend.mm
CHANGED
|
@@ -1054,6 +1054,15 @@ static double BNumArg(const Napi::CallbackInfo& info, size_t i) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
|
|
1056
1056
|
// showWindow(win, activate) — map. Popups order front without activating.
|
|
1057
|
+
//
|
|
1058
|
+
// Then `window-shown`, once the window is on screen and published: a worker
|
|
1059
|
+
// reads a window's visibility from what was published last, and defers the
|
|
1060
|
+
// frames of a window it cannot see until an event says otherwise. The event
|
|
1061
|
+
// that usually says so is AppKit's own — the move that follows ordering the
|
|
1062
|
+
// window in — but a window AppKit constrains to the screen is resized and
|
|
1063
|
+
// moved while it is still being ordered in, before it is visible, and
|
|
1064
|
+
// nothing follows. Its frames waited for good, and a `<glarea>` in it never
|
|
1065
|
+
// drew a frame.
|
|
1057
1066
|
static Napi::Value ShowWindowFn(const Napi::CallbackInfo& info) {
|
|
1058
1067
|
bool activate = info.Length() > 1 && info[1].ToBoolean().Value();
|
|
1059
1068
|
OnWindow(info[0], ^(NSWindow* win) {
|
|
@@ -1064,6 +1073,7 @@ static Napi::Value ShowWindowFn(const Napi::CallbackInfo& info) {
|
|
|
1064
1073
|
[win orderFrontRegardless];
|
|
1065
1074
|
}
|
|
1066
1075
|
PublishWindow(win);
|
|
1076
|
+
CALEmit(WindowEvent(win, "window-shown"));
|
|
1067
1077
|
});
|
|
1068
1078
|
return info.Env().Undefined();
|
|
1069
1079
|
}
|