On 11/29/25 5:44 PM, Scott Kostyshak wrote:
On Sat, Nov 29, 2025 at 04:20:55PM +0100, Jean-Marc Lasgouttes wrote:

The other question is: why does one more call to updateBuffer create such a 
problem? Many other actions trigger it.
The other slowness case I mentioned is also due to updateBuffer(): just
clicking inside and outside of the note with MergedManuals_times10.lyx.

Specifically, it is due to this code inside BufferView::mouseEventDispatch():

        if (cur.needBufferUpdate() || buffer().needUpdate()) {
                cur.clearBufferUpdate();
                buffer().updateBuffer();
        }

If I comment out that code, the mouse clicks are very responsive.

That code is definitely needed: It's where schedule buffer updates happen.

The question is why a buffer update has been scheduled just because you clicked in and out of the inset. Answer: We schedule an update every time the cursor leaves an inset. This is in BufferView::mouseSetCursor:

    bool const leftinset = (&d->cursor_.inset() != &cur.inset());
    ....
    bool update = leftinset;
    ...
    if (update)
        cur.forceBufferUpdate();

This was quite a deliberate change, way back in 1.5-beta2. I wonder if it's still required. The comments suggest it would not be "if we had a working InsetText::notifyCursorLeaves". Don't we now?

Scott, if you want to try it out, you basically just need to revert 05c47c5f. That will speed things up. But it may cause other problems.

Riki


--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to