diff options
Diffstat (limited to 'frontends/riscos/local_history.c')
-rw-r--r-- | frontends/riscos/local_history.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/frontends/riscos/local_history.c b/frontends/riscos/local_history.c index bbe6a1d12..99ed2030b 100644 --- a/frontends/riscos/local_history.c +++ b/frontends/riscos/local_history.c @@ -289,6 +289,7 @@ static nserror ro_local_history_init(struct browser_window *bw, struct ro_local_history_window **win_out) { + os_error *error; struct ro_local_history_window *ncwin; nserror res; @@ -306,7 +307,15 @@ ro_local_history_init(struct browser_window *bw, } /* create window from template */ - ncwin->core.wh = wimp_create_window(dialog_local_history_template); + error = xwimp_create_window(dialog_local_history_template, + &ncwin->core.wh); + if (error) { + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); + ro_warn_user("WimpError", error->errmess); + free(ncwin); + return NSERROR_NOMEM; + } /* initialise callbacks */ ncwin->core.draw = ro_local_history_draw; @@ -324,8 +333,7 @@ ro_local_history_init(struct browser_window *bw, return res; } - res = local_history_init(ncwin->core.cb_table, - (struct core_window *)ncwin, + res = local_history_init((struct core_window *)ncwin, bw, &ncwin->session); if (res != NSERROR_OK) { @@ -394,6 +402,17 @@ ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent) ro_gui_dialog_open_persistent(parent, lhw->core.wh, true); + /* Give the window focus. */ + error = xwimp_set_caret_position(lhw->core.wh, -1, 0, 0, -1, 0); + if (error) { + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x : %s", + error->errnum, + error->errmess); + } + + local_history_scroll_to_cursor(lhw->session); + return NSERROR_OK; } |