diff options
author | Ole Loots <ole@monochrom.net> | 2014-09-12 23:22:26 +0200 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2014-09-12 23:22:26 +0200 |
commit | a9ac9c00fc2c73705db242a459160f14d279cdcd (patch) | |
tree | 5f9aa630340bad67934e6fdbfda7f239f0fade57 /riscos/url_complete.c | |
parent | 181bc41a9aa200cfac5bf4b84175003639fce488 (diff) | |
parent | 9e6b0fb8b07cd3147b0a2727d3644860cf7c8c7e (diff) | |
download | netsurf-a9ac9c00fc2c73705db242a459160f14d279cdcd.tar.gz netsurf-a9ac9c00fc2c73705db242a459160f14d279cdcd.tar.bz2 |
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
Conflicts:
atari/gui.h
Diffstat (limited to 'riscos/url_complete.c')
-rw-r--r-- | riscos/url_complete.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/riscos/url_complete.c b/riscos/url_complete.c index 01774f62f..6881de7ea 100644 --- a/riscos/url_complete.c +++ b/riscos/url_complete.c @@ -25,19 +25,23 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "oslib/wimp.h" -#include "content/urldb.h" +#include <oslib/wimp.h> + #include "utils/log.h" +#include "utils/nsoption.h" +#include "utils/utils.h" +#include "content/urldb.h" +#include "desktop/browser.h" + #include "riscos/global_history.h" #include "riscos/gui.h" #include "riscos/mouse.h" -#include "utils/nsoption.h" #include "riscos/toolbar.h" #include "riscos/url_complete.h" #include "riscos/wimp.h" #include "riscos/wimp_event.h" #include "riscos/wimputils.h" -#include "utils/utils.h" +#include "riscos/filetype.h" #define MAXIMUM_VISIBLE_LINES 7 @@ -96,7 +100,6 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) wimp_window_state state; char *match_url; const char *url; - int i, lines; int old_selection; int height; os_error *error; @@ -144,7 +147,8 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) (strcmp(match_url, url_complete_matched_string))) { /* memorize the current matches */ - lines = MAXIMUM_VISIBLE_LINES; + int i; + int lines = MAXIMUM_VISIBLE_LINES; if (lines > url_complete_matches_available) lines = url_complete_matches_available; if (url_complete_matches) { @@ -528,8 +532,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) { osbool more; os_error *error; - int clip_y0, clip_y1, origin_y; - int first_line, last_line, line; + int line; const struct url_data *data; int type; @@ -564,9 +567,10 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) /* redraw */ more = wimp_redraw_window(redraw); while (more) { - origin_y = redraw->box.y1 - redraw->yscroll; - clip_y0 = redraw->clip.y0 - origin_y; - clip_y1 = redraw->clip.y1 - origin_y; + int first_line, last_line; + int origin_y = redraw->box.y1 - redraw->yscroll; + int clip_y0 = redraw->clip.y0 - origin_y; + int clip_y1 = redraw->clip.y1 - origin_y; first_line = (-clip_y1) / 44; last_line = (-clip_y0 + 43) / 44; @@ -656,9 +660,8 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) { wimp_window_state state; os_error *error; - int selection, old_selection; + int selection; struct gui_window *g; - const char *url; if ((mouse_x == pointer->pos.x) && (mouse_y == pointer->pos.y) && (!pointer->buttons)) @@ -678,7 +681,11 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) selection = (state.visible.y1 - pointer->pos.y - state.yscroll) / 44; if (selection != url_complete_matches_selection) { + int old_selection; + if (url_complete_matches_selection == -1) { + const char *url; + g = ro_gui_window_lookup(url_complete_parent); if (!g) return false; @@ -734,8 +741,7 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) browser_window_navigate(g->bw, url_complete_matches[url_complete_matches_selection], NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY, NULL, NULL, NULL); |