summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-15 08:46:42 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-15 11:36:38 +0300
commitad271f8359bb3c2e27779025d30eb505c1e05677 (patch)
tree9617669ef4a14387c578248844af846a5224856e
parent8b1d946983cbf1b42673c98532494af5c64aa112 (diff)
DocumentWidget: Check current tab for commands
Some commands were being handled by all tabs even though they are relevant only to the current one. IssueID #3
-rw-r--r--src/ui/documentwidget.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 1e9dd759..fce548b4 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1115,7 +1115,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1115 } 1115 }
1116 return iTrue; 1116 return iTrue;
1117 } 1117 }
1118 else if (equal_Command(cmd, "document.input.submit")) { 1118 else if (equal_Command(cmd, "document.input.submit") && document_App() == d) {
1119 iString *value = collect_String(suffix_Command(cmd, "value")); 1119 iString *value = collect_String(suffix_Command(cmd, "value"));
1120 urlEncode_String(value); 1120 urlEncode_String(value);
1121 iString *url = collect_String(copy_String(d->mod.url)); 1121 iString *url = collect_String(copy_String(d->mod.url));
@@ -1129,7 +1129,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1129 return iTrue; 1129 return iTrue;
1130 } 1130 }
1131 else if (equal_Command(cmd, "valueinput.cancelled") && 1131 else if (equal_Command(cmd, "valueinput.cancelled") &&
1132 equal_Rangecc(range_Command(cmd, "id"), "document.input.submit")) { 1132 equal_Rangecc(range_Command(cmd, "id"), "document.input.submit") && document_App() == d) {
1133 postCommand_App("navigate.back"); 1133 postCommand_App("navigate.back");
1134 return iTrue; 1134 return iTrue;
1135 } 1135 }
@@ -1163,7 +1163,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1163 postCommand_App("navigate.back"); 1163 postCommand_App("navigate.back");
1164 return iFalse; 1164 return iFalse;
1165 } 1165 }
1166 else if (equal_Command(cmd, "document.stop")) { 1166 else if (equal_Command(cmd, "document.stop") && document_App() == d) {
1167 if (d->request) { 1167 if (d->request) {
1168 postCommandf_App("document.request.cancelled doc:%p url:%s", d, cstr_String(d->mod.url)); 1168 postCommandf_App("document.request.cancelled doc:%p url:%s", d, cstr_String(d->mod.url));
1169 iReleasePtr(&d->request); 1169 iReleasePtr(&d->request);