diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2019-08-02 22:12:03 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2019-08-03 13:50:37 +0100 |
commit | f984873799b30f5bad45f58e456f6f5e8c384c16 (patch) | |
tree | 7659f11e10410f64918022d6fb3a07659e60adde /frontends | |
parent | 6826e5d612848a6c94b73d9d1cc54250ee0f17b5 (diff) | |
download | netsurf-f984873799b30f5bad45f58e456f6f5e8c384c16.tar.gz netsurf-f984873799b30f5bad45f58e456f6f5e8c384c16.tar.bz2 |
RISC OS: Attempt to implement ro_cw_scroll_visible().
Untested.
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/riscos/corewindow.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c index 84177aa90..ecd2df221 100644 --- a/frontends/riscos/corewindow.c +++ b/frontends/riscos/corewindow.c @@ -45,6 +45,7 @@ #include "riscos/window.h" #include "riscos/toolbar.h" #include "riscos/mouse.h" +#include "riscos/wimputils.h" #include "riscos/corewindow.h" #ifndef wimp_KEY_END @@ -832,7 +833,23 @@ ro_cw_update_size(struct core_window *cw, int width, int height) static void ro_cw_scroll_visible(struct core_window *cw, const struct rect *r) { - //struct ro_corewindow *ro_cw = (struct ro_corewindow *)cw; + struct ro_corewindow *ro_cw = (struct ro_corewindow *)cw; + wimp_window_state state = { + .w = ro_cw->wh, + }; + os_error *error; + + error = xwimp_get_window_state(&state); + if (error) { + NSLOG(netsurf, ERROR, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); + return; + } + + state.xscroll = r->x0 * 2; + state.yscroll = r->y0 * 2; + + ro_cw_open(PTR_WIMP_OPEN(&state)); } |