From b5a14773ff128828c260a9b022141ad0569af5f9 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Sat, 3 Mar 2007 20:49:49 +0000 Subject: Correctly calculate maximised frame heights (fix 1644216) svn path=/trunk/netsurf/; revision=3193 --- riscos/wimp.c | 11 +++++++++++ riscos/wimp.h | 1 + riscos/window.c | 11 ++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/riscos/wimp.c b/riscos/wimp.c index fd99921ba..f6c6d2250 100644 --- a/riscos/wimp.c +++ b/riscos/wimp.c @@ -58,6 +58,17 @@ int ro_get_vscroll_width(wimp_w w) { return furniture_sizes.border_widths.x1; } + +/** + * Gets the title bar height + * + * \param w the window to read (or NULL to read a cached value) + */ +int ro_get_title_height(wimp_w w) { + ro_gui_wimp_cache_furniture_sizes(w); + return furniture_sizes.border_widths.y1; +} + /** * Caches window furniture information * diff --git a/riscos/wimp.h b/riscos/wimp.h index 28b529f6f..0d91832dd 100644 --- a/riscos/wimp.h +++ b/riscos/wimp.h @@ -25,6 +25,7 @@ int ro_get_hscroll_height(wimp_w w); int ro_get_vscroll_width(wimp_w w); +int ro_get_title_height(wimp_w w); bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig); void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode); void ro_convert_pixels_to_os_units(os_coord *pixels, os_mode mode); diff --git a/riscos/window.c b/riscos/window.c index 620b61b62..1aa03a26b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1690,6 +1690,7 @@ void ro_gui_window_update_theme(void) { void gui_window_set_extent(struct gui_window *g, int width, int height) { + int screen_width; int toolbar_height = 0; struct content *content; wimp_window_state state; @@ -1719,9 +1720,13 @@ void gui_window_set_extent(struct gui_window *g, int width, int height) /* the top-level framed window is a total pain. to get it to maximise to the * top of the screen we need to fake it having a suitably large extent */ - if (g->bw->children && (g->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) - height = 16384; - + if (g->bw->children && (g->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) { + ro_gui_screen_size(&screen_width, &height); + if (g->toolbar) + height -= ro_gui_theme_toolbar_full_height(g->toolbar); + height -= ro_get_hscroll_height(g->window); + height -= ro_get_title_height(g->window); + } if (content) { width = max(width, content->width * 2 * g->option.scale); height = max(height, content->height * 2 * g->option.scale); -- cgit v1.2.3