diff options
-rw-r--r-- | desktop/gui.h | 1 | ||||
-rw-r--r-- | gtk/gtk_window.c | 4 | ||||
-rw-r--r-- | riscos/window.c | 39 |
3 files changed, 18 insertions, 26 deletions
diff --git a/desktop/gui.h b/desktop/gui.h index cb16e8864..1db455c6f 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -45,7 +45,6 @@ void gui_window_set_extent(struct gui_window *g, int width, int height); void gui_window_set_status(struct gui_window *g, const char *text); void gui_window_set_pointer(gui_pointer_shape shape); void gui_window_set_url(struct gui_window *g, const char *url); -char *gui_window_get_url(struct gui_window *g); void gui_window_start_throbber(struct gui_window *g); void gui_window_stop_throbber(struct gui_window *g); void gui_window_place_caret(struct gui_window *g, int x, int y, int height); diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c index ced6ac6bd..98d51e942 100644 --- a/gtk/gtk_window.c +++ b/gtk/gtk_window.c @@ -327,10 +327,6 @@ void gui_window_set_url(struct gui_window *g, const char *url) gtk_entry_set_text(GTK_ENTRY(g->url_bar), url); } -char *gui_window_get_url(struct gui_window *g) -{ - return gtk_entry_get_text(GTK_ENTRY(g->url_bar)); -} void gui_window_start_throbber(struct gui_window* g) { diff --git a/riscos/window.c b/riscos/window.c index 2bbd46e9f..ef620b006 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -791,20 +791,6 @@ void gui_window_set_url(struct gui_window *g, const char *url) } } -/** - * Get the contents of a window's address bar. - * - * \param g gui_window to update - * \return The url in the address bar or NULL - */ -char *gui_window_get_url(struct gui_window *g) -{ - if (!g->toolbar) - return NULL; - - return ro_gui_get_icon_string(g->toolbar->toolbar_handle, - ICON_TOOLBAR_URL); -} /** * Forces all windows to be set to the current theme @@ -1350,25 +1336,36 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height) /** - * Remove/disown the caret. + * Remove the caret, if present. * * \param g window with caret - * - * \todo: do we want to do a test if g really owns the caret ? */ void gui_window_remove_caret(struct gui_window *g) { + wimp_caret caret; os_error *error; - error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, - 0, - 0, - 0, -1); + error = xwimp_get_caret_position(&caret); + if (error) { + LOG(("xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess)); + warn_user("WimpError", error->errmess); + return; + } + + if (caret.w != g->window) + /* we don't have the caret: do nothing */ + return; + + /* hide caret, but keep input focus */ + error = xwimp_set_caret_position(g->window, -1, + -100, -100, 32, -1); if (error) { LOG(("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess)); warn_user("WimpError", error->errmess); + return; } } |