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