RISC OS: Try setting the caret position to give the window focus.

This commit is contained in:
Michael Drake 2019-08-04 14:10:30 +01:00
parent f21c41a2e5
commit 1651dc2fb1

View File

@ -384,7 +384,6 @@ ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent)
state.visible.x1 = width; state.visible.x1 = width;
state.visible.y1 = height; state.visible.y1 = height;
state.next = wimp_HIDDEN; state.next = wimp_HIDDEN;
state.flags |= wimp_WINDOW_HAS_FOCUS;
error = xwimp_open_window(PTR_WIMP_OPEN(&state)); error = xwimp_open_window(PTR_WIMP_OPEN(&state));
if (error) { if (error) {
NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s",
@ -395,6 +394,15 @@ ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent)
ro_gui_dialog_open_persistent(parent, lhw->core.wh, true); 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_get_caret_position: 0x%x : %s",
error->errnum,
error->errmess);
}
local_history_scroll_to_cursor(lhw->session); local_history_scroll_to_cursor(lhw->session);
return NSERROR_OK; return NSERROR_OK;