While working on the headline-reversion bug I encountered the worst
possible bug in the qt gui: body text got corrupted while changing
nodes, resulting in two different nodes improperly having the same
body text.  I had suspected this was happening previously, but
yesterday I saw for sure that it did happen.

This bug has appeared in every Leo gui, without exception.
Eliminating this bug is the precondition for having a usable gui.

I can not say for sure whether this bug is of recent origin.  My guess
is that it is not.  However, I can make no definite statements about
it until I understand more.

The headline reversion bug was basically a focus problem.  Alas, these
kinds of selection bugs are typically the result of race conditions.
Timing is important.  Some possibilities:

1. A blunder somewhere in the (baroque) selection logic. For example,
no part of the selection logic "downstream" from leoTree.select should
call item2position.  If it does, chaos will ensue: the presently
selected item (as far as the qt tree widget is concerned), may not
correspond to the p argument passed to leoTree.select.

2. A failure to lock out processing downstream from an event handler.

I couldn't say for sure which possibility is more likely, either way a
race condition is likely to blame.

I suspect that this bug happened when I was selecting nodes using the
mouse.  This will cause Qt selection events, possibly immediately
following or preceding Qt expansion/contraction events.

Precise timing of events is likely important, which makes this kind of
bug much harder to replicate.  If somebody can demonstrate how to make
this bug happen I would be most grateful.

However, I can't wait until the bug can be replicated easily.  That's
not guaranteed ever to happen.  Instead, I'll examine the entire
selection logic again and try to deduce any possible race conditions
from first principles.  I believe this is doable, and reexamining
complex code is always worthwhile.

Edward

P.S. I would guess that the likelihood of tk gui plugin being reliable
is high, but given the recent changes to Leo's core, I can not
guarantee that the tk gui plugin is completely solid.

EKR
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to