lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] UI updates during long operations


From: Vadim Zeitlin
Subject: Re: [lmi] UI updates during long operations
Date: Tue, 26 Jun 2018 18:27:20 +0200

On Tue, 26 Jun 2018 15:15:27 +0000 Greg Chicares <address@hidden> wrote:

GC> Might it therefore be the case that, when UponPasteCensus() calls
GC> wxSafeYield(), it pulls queued events out of the message loop, and
GC> then they are prevented from having any effect? because "it disables
GC> the user input", so in effect it's as though we had written
GC>   {
GC>   wxWindowDisabler xyzzy;
GC>   wxYield();
GC>   }
GC> ?

 Yes, this is exactly what happens. Knowing, now, that the keyboard/mouse
events are queued for later execution -- and not taken into account
immediately as I originally thought -- I don't have any trouble with
explaining this behaviour any longer: without any calls to wxYield(), the
keyboard messages synthesized by Windows itself for the application remain
in its message queue and are converted to wx events, which are then
dispatched as usual, when the program eventually gets back to the event
loop. With wxSafeYield(), these events are dispatched from inside it, while
the window is disabled, and so are just ignored. Of course, this just
spells out in more details the same conclusion that you've already arrived
to empirically, so I realize this is not really helpful and especially not
as helpful as it would have been if I had thought about this before you
spent time on testing -- sorry about this.

 The only thing I can add is that while we can rely on the latter
behaviour, I don't think we should really count on the former because the
message queue could overflow (it is relatively small) and if there were
sufficiently many unprocessed messages in it, the keyboard events could
just be lost.

GC> Let me send this now, and defer replying to the rest of your comments.

 This was a good idea as I think we can close this particular subthread as
we've established that the observed behaviour does conform to the
expectations, finally, so there is no mystery here. Let's now concentrate
on how this behaviour could be improved and I'd like to hear what do you
think about it.

 Thanks in advance,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]