diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index a7666865..9111b546 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -1004,6 +1004,17 @@ static void parseUser_DocumentWidget_(iDocumentWidget *d) { | |||
1004 | setRange_String(d->titleUser, urlUser_String(d->mod.url)); | 1004 | setRange_String(d->titleUser, urlUser_String(d->mod.url)); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | static void cacheRunGlyphs_(void *data, const iGmRun *run) { | ||
1008 | iUnused(data); | ||
1009 | if (!isEmpty_Range(&run->text)) { | ||
1010 | cache_Text(run->font, run->text); | ||
1011 | } | ||
1012 | } | ||
1013 | |||
1014 | static void cacheDocumentGlyphs_DocumentWidget_(const iDocumentWidget *d) { | ||
1015 | render_GmDocument(d->doc, (iRangei){ 0, size_GmDocument(d->doc).y }, cacheRunGlyphs_, NULL); | ||
1016 | } | ||
1017 | |||
1007 | static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) { | 1018 | static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) { |
1008 | const iRecentUrl *recent = findUrl_History(d->mod.history, d->mod.url); | 1019 | const iRecentUrl *recent = findUrl_History(d->mod.history, d->mod.url); |
1009 | if (recent && recent->cachedResponse) { | 1020 | if (recent && recent->cachedResponse) { |
@@ -1026,6 +1037,7 @@ static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) { | |||
1026 | updateSideOpacity_DocumentWidget_(d, iFalse); | 1037 | updateSideOpacity_DocumentWidget_(d, iFalse); |
1027 | updateSideIconBuf_DocumentWidget_(d); | 1038 | updateSideIconBuf_DocumentWidget_(d); |
1028 | updateVisible_DocumentWidget_(d); | 1039 | updateVisible_DocumentWidget_(d); |
1040 | cacheDocumentGlyphs_DocumentWidget_(d); | ||
1029 | postCommandf_App("document.changed doc:%p url:%s", d, cstr_String(d->mod.url)); | 1041 | postCommandf_App("document.changed doc:%p url:%s", d, cstr_String(d->mod.url)); |
1030 | return iTrue; | 1042 | return iTrue; |
1031 | } | 1043 | } |
@@ -1762,6 +1774,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
1762 | scrollToHeading_DocumentWidget_(d, cstr_String(&d->pendingGotoHeading)); | 1774 | scrollToHeading_DocumentWidget_(d, cstr_String(&d->pendingGotoHeading)); |
1763 | clear_String(&d->pendingGotoHeading); | 1775 | clear_String(&d->pendingGotoHeading); |
1764 | } | 1776 | } |
1777 | cacheDocumentGlyphs_DocumentWidget_(d); | ||
1765 | return iFalse; | 1778 | return iFalse; |
1766 | } | 1779 | } |
1767 | else if (equal_Command(cmd, "media.updated") || equal_Command(cmd, "media.finished")) { | 1780 | else if (equal_Command(cmd, "media.updated") || equal_Command(cmd, "media.finished")) { |