RISC OS: Corewindow: Fix autoscroll segfault when pointer leaves window.

This commit is contained in:
Michael Drake 2021-04-25 22:02:11 +01:00
parent c5aca9d8ce
commit 93b68a9a48
2 changed files with 13 additions and 0 deletions

View File

@ -52,6 +52,8 @@
#define wimp_KEY_END wimp_KEY_COPY
#endif
static struct ro_corewindow *ro_cw_drag_cw;
/**
* Update a windows scrollbars.
*
@ -255,6 +257,11 @@ static void ro_cw_mouse_at(wimp_pointer *pointer, void *data)
(unsigned int)pointer->w);
return;
}
if (ro_cw != ro_cw_drag_cw) {
NSLOG(netsurf, DEEPDEBUG, "Called without drag window: %p",
ro_cw);
return;
}
NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw);
/* Not a Menu click. */
@ -391,6 +398,7 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw,
ro_warn_user("WimpError", error->errmess);
}
ro_cw_drag_cw = ro_cw;
ro_mouse_drag_start(ro_cw_drag_end, ro_cw_mouse_at, NULL, NULL);
}
}
@ -1046,6 +1054,8 @@ ro_corewindow_init(struct ro_corewindow *ro_cw,
}
/* setup context for event handlers */
NSLOG(netsurf, INFO, "Setting corewindow %p for window handle %p",
ro_cw, ro_cw->wh);
ro_gui_wimp_event_set_user_data(ro_cw->wh, ro_cw);
/* register wimp events. */

View File

@ -444,6 +444,9 @@ static nserror ro_global_history_init(void)
return res;
}
NSLOG(netsurf, INFO, "Created global history corewindow: %p",
&ncwin->core);
res = global_history_init(ncwin->core.cb_table,
(struct core_window *)ncwin);
if (res != NSERROR_OK) {