bunite-core 0.11.2 → 0.11.4
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunite-core",
|
|
3
3
|
"description": "Uniting UI and Bun",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"setup:cef": "bun ../tools/bunite-dev/scripts/setup-cef.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"msgpackr": "^1.11.9"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"bunite-native-win-x64": "0.0.
|
|
27
|
+
"bunite-native-win-x64": "0.0.8",
|
|
28
28
|
"bunite-native-mac-arm64": "0.0.1",
|
|
29
29
|
"bunite-native-linux-x64": "0.0.1"
|
|
30
30
|
}
|
|
@@ -311,6 +311,19 @@ bool initRuntime(const char* engine_dir, bool /*hide_console*/,
|
|
|
311
311
|
|
|
312
312
|
g_runtime.initialized.store(true);
|
|
313
313
|
BUNITE_INFO("webview2: runtime initialized");
|
|
314
|
+
|
|
315
|
+
// Eager-start the WebView2 environment so engine_version_string is ready by
|
|
316
|
+
// the time the first BrowserWindow title is set. Bounded drain — if Edge
|
|
317
|
+
// takes longer than the budget we just fall back to "unknown".
|
|
318
|
+
ensureEnvironment([]() {});
|
|
319
|
+
auto t0 = std::chrono::steady_clock::now();
|
|
320
|
+
while (!g_runtime.env_ready && !g_runtime.shutting_down.load() &&
|
|
321
|
+
std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
322
|
+
std::chrono::steady_clock::now() - t0).count() < 500) {
|
|
323
|
+
pumpOnce();
|
|
324
|
+
Sleep(1);
|
|
325
|
+
}
|
|
326
|
+
|
|
314
327
|
return true;
|
|
315
328
|
}
|
|
316
329
|
|
|
@@ -415,7 +428,7 @@ static DWORD styleForTitleBar(const std::wstring& tbs) {
|
|
|
415
428
|
bool createWindow(uint32_t window_id, double x, double y, double w, double h,
|
|
416
429
|
const char* title, const char* title_bar_style,
|
|
417
430
|
bool transparent, bool hidden, bool minimized, bool maximized) {
|
|
418
|
-
|
|
431
|
+
BUNITE_DEBUG("webview2: createWindow id=%u xy=(%g,%g) size=(%g,%g) hidden=%d trans=%d",
|
|
419
432
|
window_id, x, y, w, h, hidden, transparent);
|
|
420
433
|
WindowHost* host = new WindowHost();
|
|
421
434
|
host->id = window_id;
|
|
@@ -444,7 +457,7 @@ bool createWindow(uint32_t window_id, double x, double y, double w, double h,
|
|
|
444
457
|
delete host;
|
|
445
458
|
return false;
|
|
446
459
|
}
|
|
447
|
-
|
|
460
|
+
BUNITE_DEBUG("webview2: createWindow hwnd=%p id=%u", hwnd, window_id);
|
|
448
461
|
host->hwnd = hwnd;
|
|
449
462
|
if (transparent) {
|
|
450
463
|
// Fully transparent layered window — pixels are sourced from the WebView2
|
|
@@ -549,7 +562,7 @@ static void wireView(ViewHost* view, std::function<void()> on_attached) {
|
|
|
549
562
|
view->container_hwnd,
|
|
550
563
|
Callback<ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>(
|
|
551
564
|
[lifetime, view_id, on_attached](HRESULT cr, ICoreWebView2Controller* ctl) -> HRESULT {
|
|
552
|
-
|
|
565
|
+
BUNITE_DEBUG("webview2: controller-create completion view=%u hr=0x%08x",
|
|
553
566
|
view_id, static_cast<unsigned>(cr));
|
|
554
567
|
if (!lifetime || !lifetime->alive.load()) return S_OK;
|
|
555
568
|
ViewHost* v = getView(view_id);
|
|
@@ -643,7 +656,7 @@ bool createView(uint32_t view_id, uint32_t window_id,
|
|
|
643
656
|
double x, double y, double w, double h,
|
|
644
657
|
bool auto_resize, bool sandbox,
|
|
645
658
|
const char* preload_origins_json) {
|
|
646
|
-
|
|
659
|
+
BUNITE_DEBUG("webview2: createView view=%u window=%u url=%s",
|
|
647
660
|
view_id, window_id, url && *url ? url : "(none)");
|
|
648
661
|
WindowHost* window = getWindow(window_id);
|
|
649
662
|
if (!window) {
|