Author: rjw
Date: Sat Mar 3 20:49:49 2007
New Revision: 3193
URL:
http://svn.semichrome.net?rev=3193&view=rev
Log:
Correctly calculate maximised frame heights (fix 1644216)
Modified:
trunk/netsurf/riscos/wimp.c
trunk/netsurf/riscos/wimp.h
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/riscos/wimp.c
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/wimp.c?rev=3193&r1=319...
==============================================================================
--- trunk/netsurf/riscos/wimp.c (original)
+++ trunk/netsurf/riscos/wimp.c Sat Mar 3 20:49:49 2007
@@ -56,6 +56,17 @@
int ro_get_vscroll_width(wimp_w w) {
ro_gui_wimp_cache_furniture_sizes(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;
}
/**
Modified: trunk/netsurf/riscos/wimp.h
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/wimp.h?rev=3193&r1=319...
==============================================================================
--- trunk/netsurf/riscos/wimp.h (original)
+++ trunk/netsurf/riscos/wimp.h Sat Mar 3 20:49:49 2007
@@ -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);
Modified: trunk/netsurf/riscos/window.c
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/window.c?rev=3193&r1=3...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Sat Mar 3 20:49:49 2007
@@ -1690,6 +1690,7 @@
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 @@
/* 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);