On Sun, Nov 30, 2025 at 02:43:04PM +0100, Scott Kostyshak wrote:
> On Sat, Nov 29, 2025 at 09:08:05PM -0500, Richard Kimberly Heck wrote:
> > 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?
> 
> Thanks for the explanation!
> > 
> > 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.
> 
> I'm happy to try. But I'm not sure I know how to revert that commit
> since the context line
> 
>   badcursor = cursor_.inset().notifyCursorLeaves(cursor_);
> 
> is no longer there (and I don't understand the code at all).
> 
> Can you provide a patch so I can test?

I got the patch from Riki. If anyone can think of anything in particular
that I should test, let me know. I'm not sure how to hammer on LyX to
try to break whatever is sensitive regarding this code :)

Scott

Attachment: signature.asc
Description: PGP signature

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

Reply via email to