From 8866964740ee1c84b8e717286a882cac28022e08 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 31 Jan 2004 18:12:08 +0000 Subject: [project @ 2004-01-31 18:12:08 by jmb] Stop grabbing input focus on fetch completion, unless the window already has the input focus. svn path=/import/netsurf/; revision=519 --- riscos/window.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/riscos/window.c b/riscos/window.c index 42d5ffcc9..5939a0127 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -323,15 +323,19 @@ void gui_window_set_status(gui_window* g, const char* text) void gui_window_set_url(gui_window *g, char *url) { + wimp_caret c; strncpy(g->url, url, 255); wimp_set_icon_state(g->data.browser.toolbar, ICON_TOOLBAR_URL, 0, 0); /* Move the caret to the url bar. * It's ok to do this as this only gets * called when fetching a new page . */ - wimp_set_caret_position(g->data.browser.toolbar, - ICON_TOOLBAR_URL, - 0,0,-1, (int) strlen(g->url) - 1); + wimp_get_caret_position(&c); + if (c.w == g->window || c.w == g->data.browser.toolbar) { + wimp_set_caret_position(g->data.browser.toolbar, + ICON_TOOLBAR_URL, + 0,0,-1, (int) strlen(g->url) - 1); + } } -- cgit v1.2.3