GNOME Bugzilla – Bug 488680
Deletes what I'm typing in the location bar while I'm typing
Last modified: 2012-06-05 14:17:51 UTC
If the location changes while I'm typing something in the location bar what I'm typing is simply erased and replaced with the new url, and the location bar loses focus.
It doesn't happen here, can you give an example of this?
1. Go here: http://www.willhostforfood.com/files/52612/test.html 2. Press Ctrl+L 3. Type "www.google.com" (without the quotes, don't press enter) 4. Wait, keep the focus in the location bar 5. Suddenly the text is replaced with http://www.indiana.edu/~smithclas/l200/ The text in the location bar should be programatically changed while the user is editing it (i.e. it has focus). This sounds like a non-issue until you set www.google.com as your homepage and Google thinks it's nice to provide you with a national version of the page and redirects you to that. Then EVERY time you open a new tab to type a new url it gets erased somewhere in the middle. That's not acceptable.
The easy way around the use case you give is to type the address first, and then press Ctrl+Enter to open it in a new tab. No redirects involved. However in the more generic case I can see that it makes sense that the address field is not set to reflect the current page URL as long as it has focus, no matter if the page is redirected.
Created attachment 104120 [details] [review] proposed patch Attached patch solves this bug (after applying the patch from bug #513345).
Seems good to me.
I committed this to trunk (apart from some superfluous whitespace changes and the removal of the LOG () line), thanks Diego for the review. Keeping the bug open so Christian can eventually backport the patch to gnome-2-22 if needed. ------------------------------------------------------------------------ r8239 | cosimoc | 2008-05-19 21:36:47 +0200 (Mon, 19 May 2008) | 4 lines Block updates of the location entry while it is keyboard-focused. This is to avoid deletion of the text while the user is typing. Close bug #488680.
+ gboolean sync_address_is_blocked; Make that guint : 1 please. Maybe I'm missing something but this patch seems overly complicated; can't we just check in sync_address if the entry has the focus and just return then without update?
Well on a quick test, using GTK_WIDGET_HAS_FOCUS() worked except when the url was selected. So if you type gmail.com, enter, and then control+l, type something to replace gmail.com it will work as expected. If you type gmail.com, enter, and then control+l, it will exhibit the 'broken' behaviour.
Hmm not sure I understand the distinction here... ctrl-L puts the focus to the url bar, so what's different between having it all selected and just typing away? This shouldn't make any diff to HAS_FOCUS()... maybe it's simply the gecko focus bug again?
Not going to happen for 2.22.x.
So this patch landed in master 5 years ago but the bug is still open? commit ef289f5590cb8d65361e022a1e8af73a84602250 Author: Cosimo Cecchi <cosimoc@src.gnome.org> Date: Mon May 19 19:36:47 2008 +0000 Block updates of the location entry while it is keyboard-focused. This is to avoid deletion of the text while the user is typing. Close bug #488680. svn path=/trunk/; revision=8239
I'm obsoleting this as 1) the patch was applied anyway eons ago and 2) I'm proposing the removal of the implemented solution as it seems innecessary as per bug 675804.