[sugar] [PATCH] Focus location entry when Browse activity launches

Eben Eliason eben.eliason at gmail.com
Wed Jun 18 21:27:29 EDT 2008


And another attempt that appears to work perfectly, though it's a
little more invasive.  I've tested this successfully while loading as
a homepage:

1. A valid URL
2. An invalid URL
3. A local file path

It works in all cases, without race conditions.  The race condition it
beats is one which causes the focus_in event to come after the text
has been set/selected, since the event handler sets the text to the
address upon focus, which (apparently) de-selects the text.  A very
curious fact is that it appears the key handler for focusing the
location bar (CTRL-L) simply calls grab_focus on the entry and nothing
else, which results in the text being selected.  This is a mystery to
me, so I'd appreciate it if someone could shed light on the
difference.  Perhaps the reason that this special select_text mumbo
jumbo is needed isn't what I thought it was...either way, it seems to
be necessary.

- Eben


On Wed, Jun 18, 2008 at 6:45 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
> Updated attempt...doesn't work perfectly (text doesn't get selected
> when a local file is loaded as the homepage)
>
> - Eben
>
> On Tue, Jun 17, 2008 at 8:09 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
>> This one is a little strange, since I added some code to handle the
>> non-XO case when it loads up an about:blank page instead.  It's still
>> pretty small, though.
>>
>> - Eben
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: browse_uri_autoselection.diff
Type: text/x-diff
Size: 3532 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080618/9f27eaef/attachment.diff 


More information about the Sugar mailing list