Angus Leeming <[EMAIL PROTECTED]> writes: > > Question: do you need to protect the call to "find_or_build"?
Probably find_or_build needs to be protected from being called while a second show() hasn't finished yet. Maybe not. Doesn't matter because you have to prevent the following call to dialog->show() anyhow. > If not, then > isn't "showing" equivalent to dialog->isVisible()? No! show() sets dialog->isVisible() to true, hide() sets it to false. While show() is busy creating, initializing and displaying the dialog it should not be called again, that's what "showing" is for. Better name it "in_show" or "critical_show". The problem is that LyX does cooperative multithreading, at least under Qt. Have a look at the static call tree I posted for bug 1790: http://bugzilla.lyx.org/show_bug.cgi?id=1790#c1 Any call to sync_events may cause calls to timeouts or dispatch functions. IMO the call to sync_events in showCursor just has to go, even if it causes cursor artefacts. Otherwise we will need to design LyX for cooperative multithreading (lots of critical sections and a LyX-owned event queue, I'd say).