summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/dialog.c10
-rw-r--r--riscos/dialog.h1
-rw-r--r--riscos/window.c34
3 files changed, 19 insertions, 26 deletions
diff --git a/riscos/dialog.c b/riscos/dialog.c
index 6359c63f3..5352f2a68 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -684,6 +684,16 @@ void ro_gui_dialog_prepare_zoom(struct gui_window *g)
ro_gui_wimp_event_memorise(dialog_zoom);
}
+/**
+ * Update the Scale View dialog to reflect the current window settings
+ *
+ * \param g the gui_window to update for
+ */
+void ro_gui_dialog_update_zoom(struct gui_window *g) {
+ if (g == ro_gui_current_zoom_gui)
+ ro_gui_dialog_prepare_zoom(g);
+}
+
bool ro_gui_dialog_openurl_apply(wimp_w w) {
url_func_result res;
diff --git a/riscos/dialog.h b/riscos/dialog.h
index 2fcc206c2..d1963565a 100644
--- a/riscos/dialog.h
+++ b/riscos/dialog.h
@@ -39,6 +39,7 @@ void ro_gui_dialog_close_persistent(wimp_w parent);
void ro_gui_dialog_click(wimp_pointer *pointer);
void ro_gui_dialog_prepare_zoom(struct gui_window *g);
+void ro_gui_dialog_update_zoom(struct gui_window *g);
void ro_gui_dialog_prepare_open_url(void);
void ro_gui_save_options(void);
void ro_gui_dialog_open_config(void);
diff --git a/riscos/window.c b/riscos/window.c
index 753c7ca56..620b61b62 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -518,27 +518,7 @@ void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1)
*/
void gui_window_redraw_window(struct gui_window *g)
{
- wimp_window_info info;
- os_error *error;
-
- assert(g);
-
- info.w = g->window;
- error = xwimp_get_window_info_header_only(&info);
- if (error) {
- LOG(("xwimp_get_window_info_header_only: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return;
- }
-
- error = xwimp_force_redraw(g->window, info.extent.x0, info.extent.y0,
- info.extent.x1, info.extent.y1);
- if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- }
+ gui_window_redraw(g, 0, -8192, 8192, 8192);
}
@@ -1394,11 +1374,13 @@ void gui_window_set_scale(struct gui_window *g, float scale)
g->option.scale = scale;
c = g->bw->current_content;
if (c) {
- /* todo: we should only call _update for contents that don't have a
- * reformat function and thus don't redraw themselves */
- browser_window_update(g->bw, false);
- g->reformat_pending = true;
- gui_reformat_pending = true;
+ ro_gui_dialog_update_zoom(g);
+ if (!content_get_reformat(c)) {
+ browser_window_update(g->bw, false);
+ } else {
+ g->reformat_pending = true;
+ gui_reformat_pending = true;
+ }
}
}