[LyX/master] Fix ToC action when cursor is in adv. F&R pane

Kornel Benko kornel at lyx.org
Thu Jun 30 16:01:27 UTC 2022


Am Thu, 30 Jun 2022 16:42:02 +0200
schrieb Jean-Marc Lasgouttes <lasgouttes.lyx.org at free.fr>:

> Le 30/06/2022 à 12:19, Kornel Benko a écrit :
> >> I propose to apply my patch for now, since it makes sense in itself. But
> >> I will investigate the rest.  
> 
> Here is the result of my investigation. First point, eventFilter is not 
> a bad design, I found out that this is the recommended way of 
> intercepting keypresses for a widget.
> 
> Second, the reason for the recursion is that, in copy_params, old_buffer 
> is set only *after* having copied everything. Therefore, if some other 
> event occurs (like we had in message()), the method will try again to 
> update the document class, although it is already trying to do it. 
> Setting old_buffer as soon as possible fixes this.
> 
> The the following patch does some refactoring to avoid checking document 
> classes all the time in eventFilter(). Can you test it? All I checked is 
> that enabling/disabling works well.
> 
> JMarc

It works, but still _many_ calls to FindAndReplaceWidget::eventFilter.
(The simple start of findadv causes here 37 calls)

	Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220630/747f64b4/attachment.asc>


More information about the lyx-devel mailing list