shithub: mycel

Download patch

ref: 8e75b098a0689018b0a0e4061f6e6c8cb4e5461f
parent: a0b30cd29a72e5544f92e0f8dd1fe0fbc55b941d
author: Philip Silva <philip.silva@protonmail.com>
date: Fri May 7 15:00:17 EDT 2021

Fix initial sluggishness

- start Website.layout in the same thread

--- a/browser/browser.go
+++ b/browser/browser.go
@@ -1320,6 +1320,8 @@
 	if err != nil {
 		log.Fatalf("get: %v", err)
 	}
+	b.Website.ContentType = ct
+	htm := string(ct.Utf8(buf))
 
 	browser = b
 	style.SetFetcher(b)
@@ -1330,7 +1332,7 @@
 	}
 	display = dui.Display
 
-	b.render(ct, buf)
+	b.Website.layout(b, htm, InitialLayout)
 
 	return
 }