@nativescript/windows 0.1.0-alpha.34 → 0.1.0-alpha.35
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.
|
@@ -61,9 +61,7 @@ namespace __PROJECT_NAME__
|
|
|
61
61
|
await CrashDiagnostics.ShowCrashDialogAsync("Script Execution Error", report);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
#if DEBUG
|
|
65
64
|
Windows.UI.Xaml.Media.CompositionTarget.Rendering += OnRenderFrame;
|
|
66
|
-
#endif
|
|
67
65
|
|
|
68
66
|
if (Window.Current.Content == null)
|
|
69
67
|
{
|
|
@@ -86,9 +84,7 @@ namespace __PROJECT_NAME__
|
|
|
86
84
|
private void OnSuspending(object sender, SuspendingEventArgs e)
|
|
87
85
|
{
|
|
88
86
|
var deferral = e.SuspendingOperation.GetDeferral();
|
|
89
|
-
#if DEBUG
|
|
90
87
|
Windows.UI.Xaml.Media.CompositionTarget.Rendering -= OnRenderFrame;
|
|
91
|
-
#endif
|
|
92
88
|
ApplicationData.Current.LocalSettings.Values[LastLaunchArgsKey] = string.Empty;
|
|
93
89
|
_runtimeHost.Dispose();
|
|
94
90
|
deferral.Complete();
|
|
@@ -109,8 +105,12 @@ namespace __PROJECT_NAME__
|
|
|
109
105
|
e.Message ?? "Unhandled exception", report);
|
|
110
106
|
}
|
|
111
107
|
|
|
108
|
+
private void OnRenderFrame(object sender, object e)
|
|
109
|
+
{
|
|
110
|
+
_runtimeHost.PumpTimers();
|
|
112
111
|
#if DEBUG
|
|
113
|
-
|
|
112
|
+
_runtimeHost.PumpDevtools();
|
|
114
113
|
#endif
|
|
114
|
+
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -40,6 +40,17 @@ namespace __PROJECT_NAME__
|
|
|
40
40
|
[DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_has_devtools))]
|
|
41
41
|
private static extern bool runtime_has_devtools();
|
|
42
42
|
|
|
43
|
+
[DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_pump_timers))]
|
|
44
|
+
private static extern void runtime_pump_timers();
|
|
45
|
+
|
|
46
|
+
/// <summary>Drain the JS timer queue. Call on the UI thread every render frame.</summary>
|
|
47
|
+
public void PumpTimers()
|
|
48
|
+
{
|
|
49
|
+
if (!_initialized) return;
|
|
50
|
+
try { runtime_pump_timers(); }
|
|
51
|
+
catch { }
|
|
52
|
+
}
|
|
53
|
+
|
|
43
54
|
#if DEBUG
|
|
44
55
|
[DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_devtools_start))]
|
|
45
56
|
private static extern IntPtr runtime_devtools_start(long runtime, ushort port);
|