[haiku-commits] Re: haiku: hrev50638 - src/apps/webpositive

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 31 Oct 2016 10:49:25 +0100

Hi,

Am 31.10.2016 um 09:24 schrieb pulkomandy@xxxxxxxxxxxxx:

905ee3fb8fde: 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.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50638
Commit:      905ee3fb8fde036bd8233479ca7b82df069bf62f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=905ee3fb8fde
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Oct 31 08:22:35 2016 UTC

----------------------------------------------------------------------------

1 file changed, 4 insertions(+)
src/apps/webpositive/URLInputGroup.cpp | 4 ++++

----------------------------------------------------------------------------

diff --git a/src/apps/webpositive/URLInputGroup.cpp 
b/src/apps/webpositive/URLInputGroup.cpp
index 97b1069..45c083f 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);

the intention is good, but I am pretty sure that this change is very broken. It's a perfectly valid situation that the URL has focus, but the user is not editing it and it needs to adopt the loaded site's URL.

I also thought that such a mechanism already existed, but I might remember wrong. I thought it was based on a delay after the user last typed into the text field.

Best reagrds,
-Stephan



Other related posts: