summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-22 10:58:37 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-22 10:58:37 +0200
commit3d02b7b06ae9a1473d0ffa43ec39330dd3a10215 (patch)
tree15d29fa60fc00c8a7b8d7de24584c60a933288e3 /src/ui/root.c
parente72764f55b49643160e387fb942ac113d66620cf (diff)
Input queries vs. navigation history
Input query responses (status 1x) are not preserved in History so that when navigating back, they are skipped. The corresponding URLs are flagged as Transient so they are not shown in the History sidebar. The History sidebar shows the query string in URLs. IssueID #382
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 4849d0c7..5bfae857 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -760,9 +760,17 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
760 if (equal_Command(cmd, "document.changed")) { 760 if (equal_Command(cmd, "document.changed")) {
761 iInputWidget *url = findWidget_Root("url"); 761 iInputWidget *url = findWidget_Root("url");
762 const iString *urlStr = collect_String(suffix_Command(cmd, "url")); 762 const iString *urlStr = collect_String(suffix_Command(cmd, "url"));
763 const enum iGmStatusCode statusCode = argLabel_Command(cmd, "status");
763 trimCache_App(); 764 trimCache_App();
764 trimMemory_App(); 765 trimMemory_App();
765 visitUrl_Visited(visited_App(), urlStr, 0); 766 visitUrl_Visited(visited_App(),
767 urlStr,
768 /* The transient flag modifies history navigation behavior on
769 special responses like input queries. */
770 category_GmStatusCode(statusCode) == categoryInput_GmStatusCode ||
771 category_GmStatusCode(statusCode) == categoryRedirect_GmStatusCode
772 ? transient_VisitedUrlFlag
773 : 0);
766 postCommand_App("visited.changed"); /* sidebar will update */ 774 postCommand_App("visited.changed"); /* sidebar will update */
767 setText_InputWidget(url, urlStr); 775 setText_InputWidget(url, urlStr);
768 checkLoadAnimation_Root_(get_Root()); 776 checkLoadAnimation_Root_(get_Root());