summaryrefslogtreecommitdiff
path: root/riscos/wimp_event.c
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2006-01-02 00:16:47 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2006-01-02 00:16:47 +0000
commit178c2f62fdccec7c9416982a2391f7b3a1b79456 (patch)
tree3259472a5cf2fe714343bd3a534e779829b97bba /riscos/wimp_event.c
parentb1fda494416fc2e044cbbac8c72c3e335af2ba37 (diff)
downloadnetsurf-178c2f62fdccec7c9416982a2391f7b3a1b79456.tar.gz
netsurf-178c2f62fdccec7c9416982a2391f7b3a1b79456.tar.bz2
[project @ 2006-01-02 00:16:47 by rjw]
Move the caret out of shaded icons on _restore svn path=/import/netsurf/; revision=1934
Diffstat (limited to 'riscos/wimp_event.c')
-rw-r--r--riscos/wimp_event.c15
1 files changed, 15 insertions, 0 deletions
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;
}