On Thu, Nov 08, 2007 at 07:01:40PM +0000, place wrote:
Johannes wrote:
when I go to e.g. www.google.com enter a search, click submit and then when the result page shows up hit Enter, I always get a segfault:
It might not be the same problem, and I don't know whether it's a reasonable fix, but I used to have a lot of trouble with forms crashing until I did the following:
diff -pur dw2/dw/fltkui.cc dw2-cur/dw/fltkui.cc --- dw2/dw/fltkui.cc 2007-10-06 22:03:01.000000000 +0000 +++ dw2-cur/dw/fltkui.cc 2007-11-04 01:46:01.000000000 +0000 @@ -40,6 +40,7 @@ #include <fltk/Symbol.h> #include <fltk/Item.h> #include <fltk/ItemGroup.h> +#include <fltk/events.h>
namespace dw { namespace fltk { @@ -467,7 +468,8 @@ void FltkEntryResource::widgetCallback ( void *data) { printf ("when = %d\n", widget->when ()); - if (widget->when () & ::fltk::WHEN_ENTER_KEY_ALWAYS) + if ((widget->when () & ::fltk::WHEN_ENTER_KEY_ALWAYS) && + (::fltk::event_key() == ::fltk::ReturnKey)) ((FltkEntryResource*)data)->emitActivate (); }
I didn't remember why I made it long ago for ui.cc, fortunately some testing showed the reason. Patch committed with the following comment: /* The (::fltk::event_key() == ::fltk::ReturnKey) test * is necessary because WHEN_ENTER_KEY also includes * other events we're not interested in. For instance pressing * The Back or Forward, buttons, or the first click on a rendered * page. BUG: this must be investigated and reported to FLTK2 team */ -- Cheers Jorge.-