summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-10-16 21:21:53 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-10-16 21:21:53 +0100
commitecd7cb8ca3749d96f949c4d99befac363793b5c9 (patch)
treed0e69f95d395e4f6d117574d8cbecc31c74ee0e7 /riscos
parent8ac1a88589134174792c772f470ff9f4dca4b76d (diff)
downloadnetsurf-ecd7cb8ca3749d96f949c4d99befac363793b5c9.tar.gz
netsurf-ecd7cb8ca3749d96f949c4d99befac363793b5c9.tar.bz2
Simplify window closing buy user proper browser_window API.
Diffstat (limited to 'riscos')
-rw-r--r--riscos/window.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/riscos/window.c b/riscos/window.c
index 3dffd1cb6..a446fd7ab 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -1652,7 +1652,7 @@ void ro_gui_window_close(wimp_w w)
os_error *error;
char *temp_name;
char *filename = NULL;
- hlcache_handle *h = NULL;
+ struct nsurl *url;
bool destroy;
error = xwimp_get_pointer_info(&pointer);
@@ -1662,14 +1662,13 @@ void ro_gui_window_close(wimp_w w)
warn_user("WimpError", error->errmess);
return;
}
- if (g->bw)
- h = g->bw->current_content;
+
if (pointer.buttons & wimp_CLICK_ADJUST) {
destroy = !ro_gui_shift_pressed();
- if (h && hlcache_handle_get_url(h)) {
- netsurf_nsurl_to_path(hlcache_handle_get_url(h),
- &filename);
+ url = browser_window_get_url(g->bw);
+ if (url != NULL) {
+ netsurf_nsurl_to_path(url, &filename);
}
if (filename != NULL) {
temp_name = malloc(strlen(filename) + 32);
@@ -1699,11 +1698,8 @@ void ro_gui_window_close(wimp_w w)
} else {
/* this is pointless if we are about to close the
* window */
- if (!destroy && g->bw != NULL &&
- g->bw->current_content != NULL)
- ro_gui_window_navigate_up(g->bw->window,
- nsurl_access(hlcache_handle_get_url(
- g->bw->current_content)));
+ if (!destroy && url != NULL)
+ ro_gui_window_navigate_up(g, nsurl_access(url));
}
}
else