|
|
You are probably right, I did not look at it. But I think it would make sense to have the Fl::awake(message) function just call the hander version, reusing any queue or other details.
On Am 7/6/21 11:07 PM schrieb imm
wrote:
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
this variable. 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
messages.
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
hazard....
I agree.
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
Fl::awake_message_queue_length(int).
--
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/06531c09-f140-9406-7adc-33c20261c74f%40online.de.
--
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/CAL-8oAjBd8VTSk6UaV1EUxzpOH27c8JQSmEFDHBARrNN5aRUPw%40mail.gmail.com.
[ Direct Link to Message ] | |
|
| |