From 178c2f62fdccec7c9416982a2391f7b3a1b79456 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Mon, 2 Jan 2006 00:16:47 +0000 Subject: [project @ 2006-01-02 00:16:47 by rjw] Move the caret out of shaded icons on _restore svn path=/import/netsurf/; revision=1934 --- riscos/wimp_event.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'riscos/wimp_event.c') diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c index 33f933602..a7a5cc08c 100644 --- a/riscos/wimp_event.c +++ b/riscos/wimp_event.c @@ -144,6 +144,8 @@ bool ro_gui_wimp_event_memorise(wimp_w w) { bool ro_gui_wimp_event_restore(wimp_w w) { struct event_window *window; struct icon_event *event; + wimp_caret caret; + os_error *error; window = ro_gui_wimp_event_find_window(w); if (!window) @@ -169,6 +171,19 @@ bool ro_gui_wimp_event_restore(wimp_w w) { ro_gui_set_icon_shaded_state(window->w, event->i, event->previous_shaded); } + + /* ensure the caret is not in a shaded icon */ + 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 false; + } + if (caret.w != w) + return true; + if (ro_gui_get_icon_shaded_state(w, caret.i)) + ro_gui_set_caret_first(w); return true; } -- cgit v1.2.3