changeset 59:9bd7bf398a0c

- Switched dillo to push a URL with fragment (anchor) into the stack. - Re-enabled scrolling with Up/Down arrows.
author jcid
date Wed, 21 Nov 2007 02:31:24 +0100
parents 002e2c5f1457
children b6766d7c342c
files ChangeLog src/cache.c src/history.c src/nav.c src/ui.cc
diffstat 5 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Nov 20 20:18:20 2007 +0100
+++ b/ChangeLog	Wed Nov 21 02:31:24 2007 +0100
@@ -40,8 +40,9 @@
  - Reimplemented html.cc using a class, removed the linkblock,
    and hooked memory-release to dw destruction.
  - Switched UI shortcuts from a global event handler to UI::handle.
- - Bound Ctrl+Space to fullscreen toggle.
-   Patches: Jorge Arellano
+ - Bound Ctrl+Space to toggle fullscreen mode.
+ - Switched dillo to push a URL with fragment (anchor) into the stack.
+   Patches: Jorge Arellano Cid
 +- Connected signals to <li> elements (fixes links within lists).
  - Enabled text, background-color and geometry in preferences.
  - Enabled clicking over image links.
--- a/src/cache.c	Tue Nov 20 20:18:20 2007 +0100
+++ b/src/cache.c	Wed Nov 21 02:31:24 2007 +0100
@@ -478,7 +478,7 @@
             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) {
--- a/src/history.c	Tue Nov 20 20:18:20 2007 +0100
+++ b/src/history.c	Wed Nov 21 02:31:24 2007 +0100
@@ -38,7 +38,8 @@
    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;
--- a/src/nav.c	Tue Nov 20 20:18:20 2007 +0100
+++ b/src/nav.c	Wed Nov 21 02:31:24 2007 +0100
@@ -201,11 +201,11 @@
    /* 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) {
--- a/src/ui.cc	Tue Nov 20 20:18:20 2007 +0100
+++ b/src/ui.cc	Wed Nov 21 02:31:24 2007 +0100
@@ -64,7 +64,7 @@
    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 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') {