Hi Rodrigo, 

I find your recent idea[0] to refresh the page on local file changes
interesting, and it could be a quite useful feature.

[0] https://github.com/dillo-browser/dillo/issues/255

I imagine it can be triggered with a tool like entr[1]:

ls /tmp/test.html | entr 'pkill -SIGUSR1 dillo'

[1] http://eradman.com/entrproject/

So far, I have a working signal handler which will act upon receipt of
a SIGUSR1 signal. It just prints the signal # to the console right now.
I am trying to make it perform an 'a_UIcmd_reload', but haven't been
successful yet:

dillo.cc:389:19: error: use of undeclared identifier 'vbw'
  a_UIcmd_reload(*vbw);
                  ^
1 error generated

bw.h and uicmd.hh are defined in dillo.cc, so its probably a skill
issue on my end :)

Any hints would be appreciated!

Regards,
Alex

--- a/src/dillo.cc      Sun Aug 11 22:21:59 2024
+++ b/src/dillo.cc      Mon Sep  2 14:21:08 2024
@@ -381,6 +381,14 @@ static DilloUrl *makeStartUrl(char *str, bool local)
 }
 
 /*
+ * Use SIGUSR1 to reload the page
+ */
+static void reload_handler(int signum)
+{
+   MSG("signum=%d\n\n", signum);
+}
+
+/*
  * MAIN
  */
 int main(int argc, char **argv)
@@ -579,6 +587,10 @@ int main(int argc, char **argv)
          a_Url_free(start_url);
       }
    }
+
+   // Reload page on SIGUSR1
+   if (signal (SIGUSR1, reload_handler) == SIG_IGN)
+      signal (SIGUSR1, SIG_IGN); 
 
    Fl::run();

--- a/src/dillo.cc	Sun Aug 11 22:21:59 2024
+++ b/src/dillo.cc	Mon Sep  2 14:21:08 2024
@@ -381,6 +381,14 @@ static DilloUrl *makeStartUrl(char *str, bool local)
 }
 
 /*
+ * Use SIGUSR1 to reload the page
+ */
+static void reload_handler(int signum)
+{
+   MSG("signum=%d\n\n", signum);
+}
+
+/*
  * MAIN
  */
 int main(int argc, char **argv)
@@ -579,6 +587,10 @@ int main(int argc, char **argv)
          a_Url_free(start_url);
       }
    }
+
+   // Reload page on SIGUSR1
+   if (signal (SIGUSR1, reload_handler) == SIG_IGN)
+      signal (SIGUSR1, SIG_IGN); 
 
    Fl::run();
 
_______________________________________________
Dillo-dev mailing list -- dillo-dev@mailman3.com
To unsubscribe send an email to dillo-dev-le...@mailman3.com

Reply via email to