summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-07-06 10:45:31 +0100
committerVincent Sanders <vince@kyllikki.org>2014-07-06 10:45:31 +0100
commit0f151e37cba454fcb863b6b38e1780f2b04be903 (patch)
tree5b0f84879eb2896158c4f3c4f82c0391c8ec3380 /riscos
parentf5c62c2291add5e6e3b8fc604831283e4883a3c6 (diff)
parent18aefabd20a16dda9ed5363088f0da5ada0d4431 (diff)
downloadnetsurf-0f151e37cba454fcb863b6b38e1780f2b04be903.tar.gz
netsurf-0f151e37cba454fcb863b6b38e1780f2b04be903.tar.bz2
Merge branch 'vince/reformatpending'
Conflicts: amiga/gui.c
Diffstat (limited to 'riscos')
-rw-r--r--riscos/gui.c14
-rw-r--r--riscos/gui.h1
-rw-r--r--riscos/window.c45
3 files changed, 22 insertions, 38 deletions
diff --git a/riscos/gui.c b/riscos/gui.c
index 00f6ebc11..3253f796f 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -1864,17 +1864,18 @@ static void riscos_poll(bool active)
/* Poll wimp. */
xhourglass_off();
track_poll_offset = ro_mouse_poll_interval();
- if (sched_active || (track_poll_offset > 0) ||
- browser_reformat_pending) {
+ if (sched_active || (track_poll_offset > 0)) {
os_t t = os_read_monotonic_time();
- if (track_poll_offset > 0)
+ if (track_poll_offset > 0) {
t += track_poll_offset;
- else
+ } else {
t += 10;
+ }
- if (sched_active && (sched_time - t) < 0)
+ if (sched_active && (sched_time - t) < 0) {
t = sched_time;
+ }
event = wimp_poll_idle(mask, &block, t, 0);
} else {
@@ -1895,9 +1896,6 @@ static void riscos_poll(bool active)
}
ro_gui_window_update_boxes();
-
- if (browser_reformat_pending && event == wimp_NULL_REASON_CODE)
- ro_gui_window_process_reformats();
}
diff --git a/riscos/gui.h b/riscos/gui.h
index bc59b5db9..3403f551e 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -134,7 +134,6 @@ void ro_gui_window_iconise(struct gui_window *g,
bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message);
void ro_gui_window_redraw_all(void);
void ro_gui_window_update_boxes(void);
-void ro_gui_window_process_reformats(void);
void ro_gui_window_quit(void);
/* void ro_gui_window_close_all(void); */
#define ro_gui_window_close_all ro_gui_window_quit /* no need for a separate fn */
diff --git a/riscos/window.c b/riscos/window.c
index 5a3369769..2ad432b2e 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -975,7 +975,6 @@ static void gui_window_update_extent(struct gui_window *g)
os_error *error;
wimp_window_info info;
wimp_window_state state;
- bool update;
unsigned int flags;
assert(g);
@@ -995,9 +994,8 @@ static void gui_window_update_extent(struct gui_window *g)
info.yscroll += scroll;
}
- /* only allow a further reformat if we've gained/lost scrollbars */
+ /* only schedule a reformat if we've gained/lost scrollbars */
flags = info.flags & (wimp_WINDOW_HSCROLL | wimp_WINDOW_VSCROLL);
- update = g->bw->reformat_pending;
g->update_extent = true;
ro_gui_window_open(PTR_WIMP_OPEN(&info));
@@ -1009,8 +1007,9 @@ static void gui_window_update_extent(struct gui_window *g)
warn_user("WimpError", error->errmess);
return;
}
- if (flags == (state.flags & (wimp_WINDOW_HSCROLL | wimp_WINDOW_VSCROLL)))
- g->bw->reformat_pending = update;
+ if (flags == (state.flags & (wimp_WINDOW_HSCROLL | wimp_WINDOW_VSCROLL))) {
+ browser_window_schedule_reformat(g->bw);
+ }
}
@@ -1557,8 +1556,7 @@ void ro_gui_window_open(wimp_open *open)
height -= size;
state.visible.y0 += size;
if (h) {
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
+ browser_window_schedule_reformat(g->bw);
}
}
state.flags |= wimp_WINDOW_HSCROLL;
@@ -1567,8 +1565,7 @@ void ro_gui_window_open(wimp_open *open)
height += size;
state.visible.y0 -= size;
if (h) {
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
+ browser_window_schedule_reformat(g->bw);
}
}
state.flags &= ~wimp_WINDOW_HSCROLL;
@@ -1583,8 +1580,7 @@ void ro_gui_window_open(wimp_open *open)
width -= size;
state.visible.x1 -= size;
if (h) {
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
+ browser_window_schedule_reformat(g->bw);
}
}
state.flags |= wimp_WINDOW_VSCROLL;
@@ -1593,8 +1589,7 @@ void ro_gui_window_open(wimp_open *open)
width += size;
state.visible.x1 += size;
if (h) {
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
+ browser_window_schedule_reformat(g->bw);
}
}
state.flags &= ~wimp_WINDOW_VSCROLL;
@@ -1607,8 +1602,7 @@ void ro_gui_window_open(wimp_open *open)
if ((g->old_width > 0) && (g->old_width != width) &&
(ro_gui_ctrl_pressed()))
new_scale = (g->bw->scale * width) / g->old_width;
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
+ browser_window_schedule_reformat(g->bw);
}
if (g->update_extent || g->old_width != width ||
g->old_height != height) {
@@ -4379,25 +4373,17 @@ void ro_gui_window_update_boxes(void)
/**
- * Process pending reformats
+ * callback from core to reformat a window.
*/
-
-void ro_gui_window_process_reformats(void)
+static void riscos_window_reformat(struct gui_window *gw)
{
- struct gui_window *g;
-
- browser_reformat_pending = false;
- for (g = window_list; g; g = g->next) {
- if (!g->bw->reformat_pending)
- continue;
- g->bw->reformat_pending = false;
- browser_window_reformat(g->bw, false,
- g->old_width / 2,
- g->old_height / 2);
+ if (gw != NULL) {
+ browser_window_reformat(gw->bw, false,
+ gw->old_width / 2,
+ gw->old_height / 2);
}
}
-
/**
* Destroy all browser windows.
*/
@@ -5174,6 +5160,7 @@ static struct gui_window_table window_table = {
.set_scroll = gui_window_set_scroll,
.get_dimensions = gui_window_get_dimensions,
.update_extent = gui_window_update_extent,
+ .reformat = riscos_window_reformat,
.set_title = gui_window_set_title,
.set_url = gui_window_set_url,