On Am 7/6/21 11:07 PM schrieb imm
On Tue, 6 Jul 2021, 21:55
Albrecht Schlosser wrote:
The static variable
is the problem, independent
of any interaction or incompatibility with the other
form of Fl::awake(). Since there is only one static
variable callling Fl::thread_message() later in user
code can only retrieve the last value assigned to
. Hence Fl::awake(void* message) is
IMHO always unreliable unless you know that messages are
queued infrequently, i.e. less than can be handled by
events. A user moving the mouse permanently would likely
lead to an "event overflow" dropping messages, whereas
Fl::awake(F, message) queues
all messages so no
message can ever be lost.
Well, strictly the queue holds the last 1024
Got me! ;-)
Once it is full, older messages will be lost to
make room for newer ones... But if the user code is lagging
1000 events behind then there are bigger problems I'd
I was never really clear why the "old" method
wasn't adapted to use the queue, though.
Perhaps it was so that legacy code would still
behave in the same manner or something?
Or because nobody thought of it or took a stab at it?
This was indeed a thought I had when I wrote my message above.
Wouldn't it be useful to queue Fl::awake(message) pointers in a
similar way (FIFO)? Fl::thread_message() would then retrieve the
first queued message. If we wanted to keep compatibility we could
limit the FIFO to exactly one entry as a user option. void
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 email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/06531c09-f140-9406-7adc-33c20261c74f%40online.de.
[ Direct Link to Message ]