summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-05-28 17:28:28 +0100
committerVincent Sanders <vince@kyllikki.org>2017-05-28 17:28:28 +0100
commit6736ab9b724702c82b4aebc61c3d51c48d9c958c (patch)
tree09015c6f0d638aace3c697a7530e5ef9dcf73715
parent79cde2cefbec54ea08ec854471aa06cdc5c367d6 (diff)
downloadnetsurf-6736ab9b724702c82b4aebc61c3d51c48d9c958c.tar.gz
netsurf-6736ab9b724702c82b4aebc61c3d51c48d9c958c.tar.bz2
fix risc os dialog opening relative to parent
-rw-r--r--frontends/riscos/dialog.c10
-rw-r--r--frontends/riscos/dialog.h1
2 files changed, 6 insertions, 5 deletions
diff --git a/frontends/riscos/dialog.c b/frontends/riscos/dialog.c
index 18df1bfe4..1758221f7 100644
--- a/frontends/riscos/dialog.c
+++ b/frontends/riscos/dialog.c
@@ -510,7 +510,8 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y)
* /param parent the parent window (NULL for centre of screen)
* /param child the child window
*/
-void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) {
+static void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child)
+{
os_error *error;
wimp_window_state state;
int mid_x, mid_y;
@@ -545,7 +546,7 @@ void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) {
/* move to the centre of the parent at the top of the stack */
dimension = state.visible.x1 - state.visible.x0;
- scroll_width = ro_get_vscroll_width(history_window);
+ scroll_width = ro_get_vscroll_width(parent);
state.visible.x0 = mid_x - (dimension + scroll_width) / 2;
state.visible.x1 = state.visible.x0 + dimension;
dimension = state.visible.y1 - state.visible.y0;
@@ -567,10 +568,11 @@ void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) {
void ro_gui_dialog_open_persistent(wimp_w parent, wimp_w w, bool pointer) {
- if (pointer)
+ if (pointer) {
ro_gui_dialog_open_at_pointer(w);
- else
+ } else {
ro_gui_dialog_open_centre_parent(parent, w);
+ }
/* todo: use wimp_event definitions rather than special cases */
if ((w == dialog_pageinfo) || (w == dialog_objinfo))
diff --git a/frontends/riscos/dialog.h b/frontends/riscos/dialog.h
index 463048436..2ec86c339 100644
--- a/frontends/riscos/dialog.h
+++ b/frontends/riscos/dialog.h
@@ -33,7 +33,6 @@ bool ro_gui_dialog_open_top(wimp_w w, struct toolbar *toolbar,
int width, int height);
void ro_gui_dialog_open_at_pointer(wimp_w w);
void ro_gui_dialog_open_xy(wimp_w, int x, int y);
-void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w w);
void ro_gui_dialog_open_persistent(wimp_w parent, wimp_w w, bool pointer);
void ro_gui_dialog_add_persistent(wimp_w parent, wimp_w w);