On Fri, May 23, 2014 at 5:24 PM, Richard Heck <rgh...@lyx.org> wrote:

>> Inside of ViewSourceWidget::updateView is it possible to tell whether
>> it was called because of a cursor movement or because of an
>> insertion/edit?
>
>
> I don't think so. You'd need to get this information during the dispatch, I
> think, which is
> likely to make this kind of hard. I think in this case, the ViewSource
> window gets updated
> as a result of a call to GuiView::updateDialogs, which is coming from
> GuiView::restartCursor,
> called from GuiApplication::updateCurrentView, which itself gets called at
> the end of the
> main GuiApplication::dispatch routine. The dialog update happens because the
> flag
> saying we need to run updateBuffer got set.

Thanks for the detailed explanation, Richard. I understand more why it
works the way it does. I think this would be too ambitious of a
project for me at the moment but maybe I'll come back to it.

> Which it should as a result of
> resetting the
> cursor since e.g. the TOC needs updating to reflect the new position.
> Indeed, not all dialogs
> need updating, but we don't have such fine-grained information.

Is there an example of a dialog that needs to be updated even when the
cursor does not change paragraphs? Even if not, there might be one in
the future though. Would a virtual in the Dialog class make sense? The
virtual could return an enum that says under which circumstance
updateView should be called.

Scott

Reply via email to