|
|
On 11/22/21 4:17 PM Albrecht Schlosser wrote:
On 11/22/21 7:46 AM Evan Laforge wrote:
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.
Addition: maybe the following call to resize()
window->resize(X, Y, lround(r.size.width/s), lround(r.size.height/s));
in line ~1246 of Fl_cocoa.mm needs to be qualified with Fl_Window:: ?
window->Fl_Window::resize(X, Y, lround(r.size.width/s),
lround(r.size.height/s));
This would avoid calling back into derived classes but again, I'm not sure.
--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/a459adb7-9dcd-be18-7462-1a0115bd0c73%40online.de.
[ Direct Link to Message ] | |
|
| |