From 905ee3fb8fde036bd8233479ca7b82df069bf62f Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 31 Oct 2016 09:22:35 +0100 Subject: [PATCH] WebPositive: do not change URL while user is editing it If you edit the URL while a page is loading, the URL could be changed from the page load process, losing your edits. We now check and update the URL only if the URL bar is currently not focused, so it is possible to edit the URL safely. --- src/apps/webpositive/URLInputGroup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apps/webpositive/URLInputGroup.cpp b/src/apps/webpositive/URLInputGroup.cpp index 97b10691d8..45c083fd68 100644 --- a/src/apps/webpositive/URLInputGroup.cpp +++ b/src/apps/webpositive/URLInputGroup.cpp @@ -666,6 +666,10 @@ URLInputGroup::TextView() const void URLInputGroup::SetText(const char* text) { + // Ignore setting the text, if the user is currently editing the URL. + if (fWindowActive && fTextView->IsFocus()) + return; + if (!text || !Text() || strcmp(Text(), text) != 0) { fTextView->SetUpdateAutoCompleterChoices(false); fTextView->SetText(text);