[WIP PATCH] Use SIGUSR1 to reload the page
<[email protected]> Mon, 2 Sep 2024 16:04:30 +0200
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
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();
_______________________________________________
Dillo-dev mailing list -- dillo-dev-lx9mn2B4QYRWk0Htik3J/[email protected]
To unsubscribe send an email to dillo-dev-leave-lx9mn2B4QYRWk0Htik3J/[email protected]
sigusr1-reload-v1.patch
(text/x-patch, 584 B)
--- 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();