summaryrefslogtreecommitdiff
path: root/riscos/window.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-12-03 19:39:36 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-12-03 19:39:36 +0000
commit54408f636072922dc53f578a12eb1fd3cfd7c7c4 (patch)
treee9d64e97c90cfe1a89b8de437b562a9056f39dd8 /riscos/window.c
parentebebdfda4bf4732aca57edc493ea07c98b9ec9d6 (diff)
downloadnetsurf-54408f636072922dc53f578a12eb1fd3cfd7c7c4.tar.gz
netsurf-54408f636072922dc53f578a12eb1fd3cfd7c7c4.tar.bz2
Fix select menu item selection in frames. Note: the API for front end select menus is a mess ATM.
svn path=/trunk/netsurf/; revision=13223
Diffstat (limited to 'riscos/window.c')
-rw-r--r--riscos/window.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/riscos/window.c b/riscos/window.c
index 1bbbf2771..5969eab09 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -177,6 +177,8 @@ static struct form_control *gui_form_select_control;
static wimp_menu *ro_gui_browser_window_menu = NULL;
/** Menu of options for form select controls. */
static wimp_menu *gui_form_select_menu = NULL;
+/** Browser window associated with open select menu. */
+static struct browser_window *ro_gui_select_menu_bw = NULL;
/** Object under menu, or 0 if no object. */
static hlcache_handle *current_menu_object = 0;
/** URL of link under menu, or 0 if no link. */
@@ -1388,6 +1390,8 @@ void gui_create_form_select_menu(struct browser_window *bw,
return;
}
+ bw = browser_window_get_root(bw);
+
gui_form_select_control = control;
ro_gui_menu_create(gui_form_select_menu,
pointer.pos.x, pointer.pos.y, bw->window->window);
@@ -4394,7 +4398,7 @@ void ro_gui_window_default_options(struct browser_window *bw)
/**
* Prepare or reprepare a form select menu, setting up the menu handle
- * global in the process.
+ * globals in the process.
*
* \param *bw The browser window to contain the menu.
* \param *control The form control needing a menu.
@@ -4420,6 +4424,8 @@ bool ro_gui_window_prepare_form_select_menu(struct browser_window *bw,
return false;
}
+ ro_gui_select_menu_bw = bw;
+
if ((gui_form_select_menu) && (control != gui_form_select_control)) {
for (i = 0; ; i++) {
free(gui_form_select_menu->entries[i].data.
@@ -4519,7 +4525,8 @@ void ro_gui_window_process_form_select_menu(struct gui_window *g,
assert(g != NULL);
if (selection->items[0] >= 0)
- form_select_process_selection(g->bw->current_content,
+ form_select_process_selection(
+ ro_gui_select_menu_bw->current_content,
gui_form_select_control,
selection->items[0]);
}