aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2007-11-21 02:31:24 +0100
committerjcid <devnull@localhost>2007-11-21 02:31:24 +0100
commitd57413d5a92a875aca6327fb227207a2eba95e81 (patch)
tree2b123f97e11d7c29402e25c0d06e7873893a370b /src
parente3dc26c04e15024ffb1b130c626bb4d5e8c7bdff (diff)
- Switched dillo to push a URL with fragment (anchor) into the stack.
- Re-enabled scrolling with Up/Down arrows.
Diffstat (limited to 'src')
-rw-r--r--src/cache.c2
-rw-r--r--src/history.c3
-rw-r--r--src/nav.c6
-rw-r--r--src/ui.cc11
4 files changed, 16 insertions, 6 deletions
diff --git a/src/cache.c b/src/cache.c
index 18347099..4f7f074c 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -478,7 +478,7 @@ static void Cache_parse_header(CacheEntry_t *entry,
entry->Flags |= CA_TempRedirect; /* 302 Temporary Redirect */
location_str = Cache_parse_field(header, "Location");
- entry->Location = a_Url_new(location_str, URL_STR_(entry->Url), 0, 0, 0);
+ entry->Location = a_Url_new(location_str,URL_STR_(entry->Url),0,0,0);
dFree(location_str);
} else if (strncmp(header + 9, "404", 3) == 0) {
diff --git a/src/history.c b/src/history.c
index f9d35ba7..ad08611b 100644
--- a/src/history.c
+++ b/src/history.c
@@ -38,7 +38,8 @@ int a_History_add_url(DilloUrl *url)
int i, idx;
for (i = 0; i < history_size; ++i)
- if (a_Url_cmp(history[i].url, url) == 0)
+ if (!a_Url_cmp(history[i].url, url) &&
+ !strcmp(URL_FRAGMENT(history[i].url), URL_FRAGMENT(url)))
return i;
idx = history_size;
diff --git a/src/nav.c b/src/nav.c
index 4652baa2..39638219 100644
--- a/src/nav.c
+++ b/src/nav.c
@@ -201,11 +201,11 @@ static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url, int offset)
/* Update navigation-stack-pointer (offset may be zero) */
Nav_stack_move_ptr(bw, offset);
- /* Page must be reloaded, if old and new url (without anchor) differ */
+ /* Page must be reloaded, if old and new url (considering anchor) differ */
MustLoad = ForceReload || !old_url;
if (old_url){
- MustLoad |= (a_Url_cmp(old_url, url) != 0);
- MustLoad |= strcmp(URL_STR(old_url), a_UIcmd_get_location_text(bw));
+ MustLoad |= (a_Url_cmp(old_url, url) ||
+ strcmp(URL_FRAGMENT(old_url), URL_FRAGMENT(url)));
}
if (MustLoad) {
diff --git a/src/ui.cc b/src/ui.cc
index 90b5f26f..943a2409 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -64,7 +64,7 @@ int NewInput::handle(int e)
int k = event_key();
bool ctrl = event_state(CTRL);
- _MSG("NewInput::handle event=%d", e);
+ _MSG("NewInput::handle event=%d\n", e);
if (ctrl && (k == 'o' || k == 'r' || k == HomeKey || k == EndKey))
return 0;
if ((e == KEY || e == KEYUP) &&
@@ -653,6 +653,15 @@ int UI::handle(int event)
{
int ret = 0;
+ _MSG("UI::handle event=%d\n", event);
+
+ // Let FLTK pass these events to child widgets.
+ if (event == KEY) {
+ if (event_key() == UpKey || event_key() == DownKey)
+ return 0;
+ }
+
+ // Handle these shortcuts here.
if (event == SHORTCUT) {
if (event_state(CTRL)) {
if (event_key() == 'l') {