summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2007-03-03 20:49:49 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2007-03-03 20:49:49 +0000
commitb5a14773ff128828c260a9b022141ad0569af5f9 (patch)
tree7222c281ac02bc490826cf4d40c8a91d1e44b599 /riscos
parent5e783e1266237c8cda3067195b2e3dde8c9aa305 (diff)
downloadnetsurf-b5a14773ff128828c260a9b022141ad0569af5f9.tar.gz
netsurf-b5a14773ff128828c260a9b022141ad0569af5f9.tar.bz2
Correctly calculate maximised frame heights (fix 1644216)
svn path=/trunk/netsurf/; revision=3193
Diffstat (limited to 'riscos')
-rw-r--r--riscos/wimp.c11
-rw-r--r--riscos/wimp.h1
-rw-r--r--riscos/window.c11
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);