diff options
Diffstat (limited to 'desktop/browser.c')
-rw-r--r-- | desktop/browser.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index c8768b949..0d7badbe2 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; } /** |