summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorSteve Fryatt <stevef@netsurf-browser.org>2014-01-02 22:22:18 +0000
committerSteve Fryatt <stevef@netsurf-browser.org>2014-01-02 22:22:18 +0000
commit286ee3834c7a20d3963b9cf288a6d091d3fb50f2 (patch)
treecd581ef5e2524f8547623597006427ea32dac0fd /riscos
parent9bd355e30c1f6aa57d42fe4f2fa6e9f521f002a4 (diff)
downloadnetsurf-286ee3834c7a20d3963b9cf288a6d091d3fb50f2.tar.gz
netsurf-286ee3834c7a20d3963b9cf288a6d091d3fb50f2.tar.bz2
In framesets, F8 views source for frame under pointer if applicable.
Diffstat (limited to 'riscos')
-rw-r--r--riscos/window.c64
1 files changed, 36 insertions, 28 deletions
diff --git a/riscos/window.c b/riscos/window.c
index f6b274a20..208f50c7b 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -1800,7 +1800,6 @@ bool ro_gui_window_keypress(wimp_key *key)
struct gui_window *g;
hlcache_handle *h;
os_error *error;
- wimp_pointer pointer;
uint32_t c = (uint32_t) key->c;
g = (struct gui_window *) ro_gui_wimp_event_get_user_data(key->w);
@@ -1809,14 +1808,6 @@ bool ro_gui_window_keypress(wimp_key *key)
h = g->bw->current_content;
- error = xwimp_get_pointer_info(&pointer);
- if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s\n",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return false;
- }
-
/* First send the key to the browser window, eg. form fields. */
if ((unsigned)c < 0x20 || (0x7f <= c && c <= 0x9f) ||
@@ -1893,7 +1884,7 @@ bool ro_gui_window_keypress(wimp_key *key)
bool ro_gui_window_toolbar_keypress(void *data, wimp_key *key)
{
- struct gui_window *g = (struct gui_window *) data;
+ struct gui_window *g = (struct gui_window *) data;
if (g != NULL)
return ro_gui_window_handle_local_keypress(g, key, true);
@@ -1917,20 +1908,38 @@ bool ro_gui_window_toolbar_keypress(void *data, wimp_key *key)
bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
bool is_toolbar)
{
- hlcache_handle *h;
- const char *toolbar_url;
- float scale;
- uint32_t c = (uint32_t) key->c;
- wimp_scroll_direction xscroll = wimp_SCROLL_NONE;
- wimp_scroll_direction yscroll = wimp_SCROLL_NONE;
- nsurl *url;
- nserror error;
+ hlcache_handle *h;
+ struct contextual_content cont;
+ os_error *ro_error;
+ wimp_pointer pointer;
+ os_coord pos;
+ const char *toolbar_url;
+ float scale;
+ uint32_t c = (uint32_t) key->c;
+ wimp_scroll_direction xscroll = wimp_SCROLL_NONE;
+ wimp_scroll_direction yscroll = wimp_SCROLL_NONE;
+ nsurl *url;
+ nserror error;
if (g == NULL)
return false;
+ ro_error = xwimp_get_pointer_info(&pointer);
+ if (ro_error) {
+ LOG(("xwimp_get_pointer_info: 0x%x: %s\n",
+ ro_error->errnum, ro_error->errmess));
+ warn_user("WimpError", ro_error->errmess);
+ return false;
+ }
+
+ if (!ro_gui_window_to_window_pos(g, pointer.pos.x, pointer.pos.y, &pos))
+ return false;
+
+
h = g->bw->current_content;
+ browser_window_get_contextual_content(g->bw, pos.x, pos.y, &cont);
+
switch (c) {
case IS_WIMP_KEY + wimp_KEY_F1: /* Help. */
{
@@ -2015,7 +2024,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
return true;
case IS_WIMP_KEY + wimp_KEY_F8: /* View source */
- ro_gui_view_source(h);
+ ro_gui_view_source((cont.main != NULL) ? cont.main : h);
return true;
case IS_WIMP_KEY + wimp_KEY_F9:
@@ -2848,10 +2857,10 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
error = nsurl_create(current_menu_url, &url);
if (error == NSERROR_OK) {
error = browser_window_navigate(bw,
- url,
- hlcache_handle_get_url(h),
- BROWSER_WINDOW_DOWNLOAD |
- BROWSER_WINDOW_VERIFIABLE,
+ url,
+ hlcache_handle_get_url(h),
+ BROWSER_WINDOW_DOWNLOAD |
+ BROWSER_WINDOW_VERIFIABLE,
NULL,
NULL,
NULL);
@@ -3035,12 +3044,12 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
}
break;
case BROWSER_WINDOW_STAGGER:
- nsoption_set_bool(window_stagger,
+ nsoption_set_bool(window_stagger,
!nsoption_bool(window_stagger));
ro_gui_save_options();
break;
case BROWSER_WINDOW_COPY:
- nsoption_set_bool(window_size_clone,
+ nsoption_set_bool(window_size_clone,
!nsoption_bool(window_size_clone));
ro_gui_save_options();
break;
@@ -3637,7 +3646,7 @@ void ro_gui_window_toolbar_click(void *data,
case TOOLBAR_URL_ADJUST_HOTLIST:
ro_gui_window_action_remove_bookmark(g);
break;
-
+
default:
break;
}
@@ -3749,7 +3758,7 @@ void ro_gui_window_toolbar_click(void *data,
warn_user(messages_get_errorcode(error), 0);
} else {
/* do it without loading the content
- * into the new window
+ * into the new window
*/
ro_gui_window_navigate_up(new_bw->window,
nsurl_access(hlcache_handle_get_url(h)));
@@ -5255,4 +5264,3 @@ bool ro_gui_alt_pressed(void)
xosbyte1(osbyte_SCAN_KEYBOARD, 2 ^ 0x80, 0, &alt);
return (alt == 0xff);
}
-