I was tracking down a bug and it turned out to be caused when I call
resize() on a window "from the outside" (so it's my program doing it,
rather than the OS doing it via a window drag). On OS X (with fltk
head), it turns out that each call to resize() causes it to be called
twice, reentrantly. I tried it on X11 (with fltk at 3bb34), and the
reentrant call doesn't happen, but resize gets called 4 times.
I can confirm this behavior.
I'm not sure if this is a bug or not, but it is a bit odd, and it did
cause a bug in my program, which wasn't expecting reentrant calls.
I believe it is a bug. If your derived class calls Fl_Window::resize()
in its own resize() method it should not be called back by this. In the
theory you are supposed to *react* on the resize request sent by the
system. If you call Fl_Window::resize() (the base class) this *should*
confirm the resize request and not send another one.
I could track it down to a point (actually two) in src/Fl_cocoa.mm but
I'm not sure it this is the right fix.
@Manolo: I'm attaching my modified test program and a potential
workaround in the diff file. This should help to track down the problem.
TIA.
Note: I'm aware that this is very likely not the correct solution, I
assume you may find a better one.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.