Vincent van Ravesteijn - TNW wrote:
v...@lyx.org wrote:
Author: vfr
Date: Wed Mar 25 23:40:04 2009
New Revision: 28911
URL: http://lyx.lyx.org/trac/changeset/28911
Log:
Revert cs 28908: wrong fix.
Yeah, I was about to ask why...
:-)
Abdel.
But the problem is pretty serious, annoying and still exists.
Oh I believe you.
If I start LyX, create a new document while the mouse is in the
workarea, LyX asserts in TextMetrics::pitNearY, which is called by
checkInsetHit:
LASSERT(!par_metrics_.empty())
Abdel, why is this assert there ?
Because you won't find anything if there is nothing to find. This assert
is here to make sure that getPitNearY() is called at the right time,
that is _after_ the metrics has been calculated. In this case,
checkInsetHit() is of course related to the mouse.
When is the cache (par_metrics_) being
filled ?
At metrics calculation time.
I only see this in trunk and with Qt4.5 (although all different
branches/versions/qt-versions are getting messed up a bit).
It seems that there is a race condition between the first metrics update
and the first mouse event handling. The solution is possibly to make
sure that the mouse event is ignored up until the workarea is properly
drawn.
Warning: This is out of my head, I didn't look at the source...
Abdel.