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

Jean-Marc Lasgouttes lasgouttes.lyx.org at free.fr
Thu Jun 30 14:42:02 UTC 2022


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixup-c30b0aac-protect-against-bad-recursion.patch
Type: text/x-patch
Size: 3997 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220630/4a174889/attachment.bin>


More information about the lyx-devel mailing list