From a1951f4c49a44783478c7000bd5ac5d349375488 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 3 Aug 2019 16:57:28 +0100 Subject: RISC OS: Fix ro_cw_get_window_dimensions to account for toolbar height. --- frontends/riscos/corewindow.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'frontends/riscos') 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; } -- cgit v1.2.3