diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-15 08:46:42 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-15 08:46:42 +0300 |
commit | 3efbc802805770e0fcd7bcb92e33b968ca3bef57 (patch) | |
tree | 28e79a026592042e777ede817c7d6a58d72a2e0a | |
parent | 8aaf00a911054c9066af838cf0fc10af7c724e01 (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.c | 6 |
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); |