From 6736ab9b724702c82b4aebc61c3d51c48d9c958c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 28 May 2017 17:28:28 +0100 Subject: fix risc os dialog opening relative to parent --- frontends/riscos/dialog.c | 10 ++++++---- frontends/riscos/dialog.h | 1 - 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); -- cgit v1.2.3