summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-09-21 09:36:43 (GMT)
committer Daniel Silverstone <dsilvers@digital-scurf.org>2017-09-21 09:36:43 (GMT)
commit643f217bacc7f8ec643abff5bbbd12c360293f18 (patch)
tree331189717fe5158512f8d9a43677cc5f241532cd
parent2c36eb4e217cf2528c8cb6d120fb9a662f212376 (diff)
downloadnetsurf-643f217bacc7f8ec643abff5bbbd12c360293f18.tar.gz
netsurf-643f217bacc7f8ec643abff5bbbd12c360293f18.tar.bz2
Rework browser_window_set_scroll() slightly to record new scroll offsetsdsilvers/scrolloffset
-rw-r--r--desktop/browser.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index c8768b9..0d7badb 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -602,18 +602,24 @@ static nserror
browser_window_set_scroll(struct browser_window *bw,
const struct rect *rect)
{
+ nserror ret = NSERROR_OK;
+
if (bw->window != NULL) {
- return guit->window->set_scroll(bw->window, rect);
+ ret = guit->window->set_scroll(bw->window, rect);
+ } else {
+ if (bw->scroll_x != NULL) {
+ scrollbar_set(bw->scroll_x, rect->x0, false);
+ }
+ if (bw->scroll_y != NULL) {
+ scrollbar_set(bw->scroll_y, rect->y0, false);
+ }
}
- if (bw->scroll_x != NULL) {
- scrollbar_set(bw->scroll_x, rect->x0, false);
- }
- if (bw->scroll_y != NULL) {
- scrollbar_set(bw->scroll_y, rect->y0, false);
- }
+ /* update the history entry with current scroll offsets */
+ if (ret == NSERROR_OK)
+ browser_window_history_update(bw, bw->current_content);
- return NSERROR_OK;
+ return ret;
}
/**