mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-24 07:19:37 +03:00
Port RISC OS front end to browser_window_get_contextual_content. Adds support for saving link pointed to from imagemap. Fixes behaviour with frames.
svn path=/trunk/netsurf/; revision=12758
This commit is contained in:
parent
a8a28345dd
commit
5af1284c73
@ -2124,15 +2124,15 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
|
||||
{
|
||||
struct gui_window *g;
|
||||
struct browser_window *bw;
|
||||
hlcache_handle *h;
|
||||
struct toolbar *toolbar;
|
||||
struct contextual_content cont;
|
||||
hlcache_handle *h = NULL;
|
||||
bool export_sprite, export_draw;
|
||||
os_coord pos;
|
||||
|
||||
g = (struct gui_window *) ro_gui_wimp_event_get_user_data(w);
|
||||
toolbar = g->toolbar;
|
||||
bw = g->bw;
|
||||
h = bw->current_content;
|
||||
|
||||
/* If this is the form select menu, handle it now and then exit.
|
||||
* Otherwise, carry on to the main browser window menu.
|
||||
@ -2156,25 +2156,14 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
|
||||
current_menu_object = NULL;
|
||||
current_menu_url = NULL;
|
||||
|
||||
if (h != NULL &&
|
||||
ro_gui_window_to_window_pos(g, pointer->pos.x,
|
||||
if (ro_gui_window_to_window_pos(g, pointer->pos.x,
|
||||
pointer->pos.y, &pos)) {
|
||||
switch (content_get_type(h)) {
|
||||
case CONTENT_HTML: {
|
||||
struct box *box;
|
||||
box = box_object_at_point(h, pos.x, pos.y);
|
||||
current_menu_object = box ? box->object : NULL;
|
||||
box = box_href_at_point(h, pos.x, pos.y);
|
||||
current_menu_url = box ? box->href : NULL;
|
||||
}
|
||||
break;
|
||||
case CONTENT_TEXTPLAIN:
|
||||
/* no object, no url */
|
||||
break;
|
||||
default:
|
||||
current_menu_object = h;
|
||||
break;
|
||||
}
|
||||
browser_window_get_contextual_content(bw,
|
||||
pos.x, pos.y, &cont);
|
||||
h = cont.main;
|
||||
|
||||
current_menu_object = cont.object;
|
||||
current_menu_url = cont.link_url;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user