summaryrefslogtreecommitdiff
path: root/desktop/browser.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/browser.c')
-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;
}
/**