summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2019-08-03 16:57:28 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2019-08-03 16:57:28 +0100
commita1951f4c49a44783478c7000bd5ac5d349375488 (patch)
tree3f6643b8918f5920ad64f629238b82b8d09e95ab
parent01485d06baf0098c2f0ec3ac48ea49150e550de9 (diff)
downloadnetsurf-a1951f4c49a44783478c7000bd5ac5d349375488.tar.gz
netsurf-a1951f4c49a44783478c7000bd5ac5d349375488.tar.bz2
RISC OS: Fix ro_cw_get_window_dimensions to account for toolbar height.
-rw-r--r--frontends/riscos/corewindow.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c
index a54435287..8004dcc95 100644
--- a/frontends/riscos/corewindow.c
+++ b/frontends/riscos/corewindow.c
@@ -904,6 +904,15 @@ ro_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
*width = (state.visible.x1 - state.visible.x0) / 2;
*height = (state.visible.y1 - state.visible.y0) / 2;
+
+ /* Account for toolbar height, if present */
+ if (ro_cw->toolbar != NULL) {
+ *height -= ro_toolbar_full_height(ro_cw->toolbar) / 2;
+ }
+ if (*height < 0) {
+ *height = 0;
+ }
+
return NSERROR_OK;
}