Hello I'm new to both dillo and fltk. I'm trying to do two things and I'm hoping you can point me in the right directions on how to do it. 1) flicker at reload When doing a reload my screen flickers and I'd like to get rid of that. I first tried the dillorc option buffered_drawing=0/1/2 but that didn't make any difference. I then tried to find the source where the screen is cleared before redrawing the page. I followed the source of redraw() until layout.cc where topLevel->draw() is executed but I cannot find its implementation. Is the flickering an fltk issue or where is the screen cleared? 2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach? Many thanks Stefan.
Hi Stefan, On Tue, Oct 13, 2009 at 06:48:51PM +0200, Stefan Strobl wrote:
Hello
I'm new to both dillo and fltk. I'm trying to do two things and I'm hoping you can point me in the right directions on how to do it.
1) flicker at reload When doing a reload my screen flickers and I'd like to get rid of that. I first tried the dillorc option buffered_drawing=0/1/2 but that didn't make any difference. I then tried to find the source where the screen is cleared before redrawing the page. I followed the source of redraw() until layout.cc where topLevel->draw() is executed but I cannot find its implementation.
I would recommend to start in FltkViewBase::draw(). Or maybe FltkViewport::draw() if you are interested in scrolling too.
Is the flickering an fltk issue or where is the screen cleared?
I'm not sure. It might just be that the freshly loaded page is rendered while it is not 100% loaded, which would blank the screen. Then it is drawn again after loading has completed. I would suggest to put printf()s in FltkViewBase::draw() (the actual draw) and Layout::queueResize() (which requests a complete redraw) to see what is going on. You can also use gdb an breakpoints of course. The flickering is certainly caused by dillo code and is not a general issue of fltk.
2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach?
If you just need to trigger a reload, SIGUSR2 might be ok. For a more general remote control fifo's or maybe stdin might be an option. You can check what other browsers do. Cheers, Johannes PS: Please let us know your findings!
Johannes wrote:
On Tue, Oct 13, 2009 at 06:48:51PM +0200, Stefan Strobl wrote:
2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach?
If you just need to trigger a reload, SIGUSR2 might be ok. For a more general remote control fifo's or maybe stdin might be an option. You can check what other browsers do.
I remember Enrico Weigelt talking some on the list last year about using 9P for things like this. I don't think he implemented anything, though. I have no idea whether it would be trivial or a whole lot of work...
On Tue, Oct 13, 2009 at 07:13:45PM +0200, Johannes Hofmann wrote:
Hi Stefan,
On Tue, Oct 13, 2009 at 06:48:51PM +0200, Stefan Strobl wrote:
Hello
I'm new to both dillo and fltk. I'm trying to do two things and I'm hoping you can point me in the right directions on how to do it.
1) flicker at reload When doing a reload my screen flickers and I'd like to get rid of that. I first tried the dillorc option buffered_drawing=0/1/2 but that didn't make any difference. I then tried to find the source where the screen is cleared before redrawing the page. I followed the source of redraw() until layout.cc where topLevel->draw() is executed but I cannot find its implementation.
I would recommend to start in FltkViewBase::draw(). Or maybe FltkViewport::draw() if you are interested in scrolling too.
Is the flickering an fltk issue or where is the screen cleared?
I'm not sure. It might just be that the freshly loaded page is rendered while it is not 100% loaded, which would blank the screen. Then it is drawn again after loading has completed. I would suggest to put printf()s in FltkViewBase::draw() (the actual draw) and Layout::queueResize() (which requests a complete redraw) to see what is going on. You can also use gdb an breakpoints of course. The flickering is certainly caused by dillo code and is not a general issue of fltk.
2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach?
If you just need to trigger a reload, SIGUSR2 might be ok. For a more general remote control fifo's or maybe stdin might be an option. You can check what other browsers do.
Ditto. I have the idea of a remote control dpi for dillo that allows to command it as necessary (think of a help browser). In this case you'd need reload and maybe the ability to send it to other pages or make it cycle or whatever. This feature needs a revision of the dillo plugin protocol (DPIP). I've been working on it for some time now, and hope to commit big changes this month. With regard to using dillo as a display for embedded devices, the idea is feasible and you'd be good testing with SIGUSR2 and reload by now. The golden idea is to use dpip to be able to update individual widgets using DOM. That would be really good. Specially if there was an interested sponsor! ;) -- Cheers Jorge.-
Johannes Hofmann wrote:
On Tue, Oct 13, 2009 at 06:48:51PM +0200, Stefan wrote:
1) flicker at reload When doing a reload my screen flickers and I'd like to get rid of that. I first tried the dillorc option buffered_drawing=0/1/2 but that didn't make any difference. I then tried to find the source where the screen is cleared before redrawing the page. I followed the source of redraw() until layout.cc where topLevel->draw() is executed but I cannot find its implementation.
I'm not sure. It might just be that the freshly loaded page is rendered while it is not 100% loaded, which would blank the screen. Then it is drawn again after loading has completed. I would suggest to put printf()s in FltkViewBase::draw() (the actual draw) and Layout::queueResize() (which requests a complete redraw) to see what is going on. You can also use gdb an breakpoints of course.
Thanks for the feedback to all of you. I'll try to find the origin of the flickering.
2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach?
If you just need to trigger a reload, SIGUSR2 might be ok. For a more general remote control fifo's or maybe stdin might be an option. You can check what other browsers do.
Please see below the patch on how I've done it. Two issues: a) The signal() function is ambiguous because there's a namespace lout::signal in lout/signal.hh. I don't know how to tell the compiler to use the correct signal(). I tried std::signal() but that didn't work. If I temporarily rename the lout::signal to something else the patch seems to work. b) Using SIGUSR, do I have to worry about interrupting the main flow of dillo at a bad moment, or is it safe the way I've done it? I think other browsers use IPC mechanisms of the toolkit for things like this, but I think fltk2 doesn't provide some such thing. Many thanks Stefan. ----- diff -r 7cdd8e4f8076 src/uicmd.cc --- a/src/uicmd.cc Sat Oct 10 03:04:12 2009 +0000 +++ b/src/uicmd.cc Wed Oct 14 13:20:04 2009 +0200 @@ -15,6 +15,7 @@ #include <stdio.h> #include <stdarg.h> #include <math.h> /* for rint */ +#include <signal.h> #include <fltk/draw.h> #include <fltk/damage.h> @@ -44,6 +45,21 @@ // Handy macro #define BW2UI(bw) ((UI*)((bw)->ui)) + +/* + * sig_usr() + */ +static void sig_usr(int signo) +{ + int i; + if (signo == SIGUSR1) { + for (i=0; i<a_Bw_num(); i++) + a_UIcmd_reload(a_Bw_get(i)); +// a_Nav_reload(a_Bw_get(i)); + } + else + MSG_WARN("received signal %d\n", signo); +} // Platform idependent part using namespace dw::core; @@ -472,6 +488,10 @@ BrowserWindow *a_UIcmd_browser_window_ne win->callback(win_cb, new_bw); + /* setup SIGUSR1 for external triggering of reload */ + if (signal(SIGUSR1, sig_usr) == SIG_ERR) + MSG_WARN("can't catch SIGUSR1\n"); + return new_bw; }
On Wed, Oct 14, 2009 at 01:34:43PM +0200, Stefan wrote:
Johannes Hofmann wrote:
On Tue, Oct 13, 2009 at 06:48:51PM +0200, Stefan wrote:
1) flicker at reload When doing a reload my screen flickers and I'd like to get rid of that. I first tried the dillorc option buffered_drawing=0/1/2 but that didn't make any difference. I then tried to find the source where the screen is cleared before redrawing the page. I followed the source of redraw() until layout.cc where topLevel->draw() is executed but I cannot find its implementation.
I'm not sure. It might just be that the freshly loaded page is rendered while it is not 100% loaded, which would blank the screen. Then it is drawn again after loading has completed. I would suggest to put printf()s in FltkViewBase::draw() (the actual draw) and Layout::queueResize() (which requests a complete redraw) to see what is going on. You can also use gdb an breakpoints of course.
Thanks for the feedback to all of you. I'll try to find the origin of the flickering.
2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach?
If you just need to trigger a reload, SIGUSR2 might be ok. For a more general remote control fifo's or maybe stdin might be an option. You can check what other browsers do.
Please see below the patch on how I've done it. Two issues: a) The signal() function is ambiguous because there's a namespace lout::signal in lout/signal.hh. I don't know how to tell the compiler to use the correct signal(). I tried std::signal() but that didn't work. If I temporarily rename the lout::signal to something else the patch seems to work.
That's a bug. I will fix it.
b) Using SIGUSR, do I have to worry about interrupting the main flow of dillo at a bad moment, or is it safe the way I've done it?
You should just set a flag in the sighandler and do the actual work from the normal context (when the flag is set). Otherwise strange things will happen depending on what dillo is currently doing when you send the signal. Cheers, Johannes
On Wed, Oct 14, 2009 at 07:44:41PM +0200, Johannes Hofmann wrote:
On Wed, Oct 14, 2009 at 01:34:43PM +0200, Stefan wrote:
Johannes Hofmann wrote:
On Tue, Oct 13, 2009 at 06:48:51PM +0200, Stefan wrote:
1) flicker at reload When doing a reload my screen flickers and I'd like to get rid of that. I first tried the dillorc option buffered_drawing=0/1/2 but that didn't make any difference. I then tried to find the source where the screen is cleared before redrawing the page. I followed the source of redraw() until layout.cc where topLevel->draw() is executed but I cannot find its implementation.
I'm not sure. It might just be that the freshly loaded page is rendered while it is not 100% loaded, which would blank the screen. Then it is drawn again after loading has completed. I would suggest to put printf()s in FltkViewBase::draw() (the actual draw) and Layout::queueResize() (which requests a complete redraw) to see what is going on. You can also use gdb an breakpoints of course.
Thanks for the feedback to all of you. I'll try to find the origin of the flickering.
2) externally trigger reload I'd like to trigger a page reload externally by another application. I searched a bit about IPC mechanisms of fltk but didn't find any. So I'm thinking about using a UNIX fifo or the system signal SIGUSR2. Do you think this is a good approach?
If you just need to trigger a reload, SIGUSR2 might be ok. For a more general remote control fifo's or maybe stdin might be an option. You can check what other browsers do.
Please see below the patch on how I've done it. Two issues: a) The signal() function is ambiguous because there's a namespace lout::signal in lout/signal.hh. I don't know how to tell the compiler to use the correct signal(). I tried std::signal() but that didn't work. If I temporarily rename the lout::signal to something else the patch seems to work.
That's a bug. I will fix it.
It should be fixed now. Please check again with current tip. Cheers, Johannes
participants (4)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
nst@gersys.de