Am 08.02.2011 um 08:02 schrieb Stephan Witt:

> Am 07.02.2011 um 21:15 schrieb LyX Ticket Tracker:
> 
>> #7209: assertion when clicking on unfinished command in math
>> Ticket URL: <http://www.lyx.org/trac/ticket/7209#comment:5>
>> -----------------------+----------------------------------------------------
>> Reporter:  uwestoehr  |        Owner:  poenitz 
>>    Type:  defect     |       Status:  reopened
>> Priority:  high       |    Milestone:  1.6.9   
>> Component:  mathed     |      Version:  1.6.8   
>> Severity:  critical   |   Resolution:          
>> Keywords:             |  
>> -----------------------+----------------------------------------------------
>> Changes (by metrics):
>> 
>> * status:  closed => reopened
>> * resolution:  fixed =>
>> 
>> 
>> Comment:
>> 
>> I can still reproduce this (or a related bug) in beta 4. Create a
>> displayed math inset, type \var, wait for the autocompletion to appear,
>> then _right_ click on the backslash.
> 
> Indeed this is a related bug. The menu expansion crashes now in 
> MenuDefinition::expandSpellingSuggestions().
> 
> I tried to add an early return there if we are in math mode. If I do so I can 
> see the real cause for the problem: the right button opens the wrong menu. It 
> should be the math context menu and in fact it is the normal text menu. But 
> only the first time - if the crash is avoided every following right click 
> opens the math menu. So, there is something wrong with the menu binding. I 
> don't know enough about that machinery... but the early return patch only 
> hides the root cause I think.

It turns out the problem is the missing metrics info somehow.
BufferView::contextMenu() tries to choose the correct context menu for cursor 
position.
This ends up in TextMetrics::checkInsetHit() ... 
... there the math inset isn't found because probably it's metrics are not 
correct.
So, finally the "covering_inset" in BufferView::contextMenu() is 0 and the 
default
context menu "context-edit" is the result. Unfortunately it's not a good idea to
try this on a math inset.

To fix it we have to correct the metrics computation time.
Is this a known issue? I'd guess that's not an easy business.

Stephan

Reply via email to