Skip to content

Commit 0d6300e

Browse files
committed
Animation page lag
1 parent 019061b commit 0d6300e

5 files changed

Lines changed: 1452 additions & 17 deletions

File tree

Uno.Gallery/App.xaml.cs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
using ShowMeTheXAML;
88
using System;
99
using System.Linq;
10+
using System.Net.Sockets;
11+
using System.Net;
1012
using System.Reflection;
13+
using System.Text;
1114
using Uno.Extensions;
1215
using Uno.Gallery.Entities;
1316
using Uno.Gallery.Helpers;
@@ -22,6 +25,52 @@
2225

2326
namespace Uno.Gallery
2427
{
28+
public class ConsoleForwarder
29+
{
30+
public static void Enable(string ip, int port = 1234)
31+
{
32+
var client = new TcpClient { NoDelay = true };
33+
client.Connect(IPAddress.Parse(ip), port);
34+
35+
var writer = new StreamWriter(client.GetStream(), Encoding.UTF8) { AutoFlush = true };
36+
Console.SetOut(writer);
37+
Console.SetError(writer);
38+
39+
Console.WriteLine($"Console forwarding to {ip}:{port} is active!");
40+
41+
var stayAlive = new Timer(_ =>
42+
{
43+
Console.WriteLine($"[[[ ALIVE ]]] {DateTime.Now:F} [[[ ALIVE ]]] .");
44+
writer.Flush();
45+
});
46+
stayAlive.Change(30_000, 30_000);
47+
}
48+
}
49+
50+
public class ConsoleWriter
51+
{
52+
public static void Enable(string? path = null)
53+
{
54+
path ??= $"C:\\tmp\\log-{DateTime.Now:yy-MM-dd HH-mm-ss}.txt";
55+
var file = File.Open(path, FileMode.CreateNew, FileAccess.Write, FileShare.ReadWrite);
56+
57+
var writer = new StreamWriter(file, Encoding.UTF8) { AutoFlush = true };
58+
Console.SetOut(writer);
59+
Console.SetError(writer);
60+
61+
Console.WriteLine($"Console writing to {path} is active!");
62+
63+
var stayAlive = new Timer(_ =>
64+
{
65+
Console.WriteLine($"[[[ ALIVE ]]] {DateTime.Now:F} [[[ ALIVE ]]] .");
66+
writer.Flush();
67+
});
68+
stayAlive.Change(30_000, 30_000);
69+
}
70+
}
71+
72+
73+
2574
/// <summary>
2675
/// Provides application-specific behavior to supplement the default Application class.
2776
/// </summary>
@@ -39,6 +88,9 @@ public partial class App : Application
3988
/// </summary>
4089
public App()
4190
{
91+
//ConsoleForwarder.Enable("172.20.100.242");
92+
ConsoleWriter.Enable();
93+
4294
Instance = this;
4395

4496
ConfigureFeatureFlags();

Uno.Gallery/Platforms/Desktop/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static void Main(string[] args)
1414
.UseX11()
1515
.UseLinuxFrameBuffer()
1616
.UseMacOS()
17-
#if HAS_SKIA_RENDERER
17+
#if HAS_SKIA_RENDERER || true
1818
.UseWin32()
1919
#else
2020
.UseWindows()

0 commit comments

Comments
 (0)