Jean-Marc Lasgouttes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdel, I think the problem is that, when right-clicking on an inset
button, I think the cursor should be set to include the isnet as a
slice, even when the inset is closed or is not highly editable.
Won't this lead to crash or assertion in DocIterator?

I do not know yet the answer :)

Do you know where this should be fixed?
In BufferView::mouseSetCursor() I guess, it is called in Text3.cpp:
Text::dispatch() when handling LFUN_MOUSE_PRESS call.

I think we should arrange to have the context menu (and only that)
called with cursor set inside the inset. I do not know how to do it.
Really setting the cursor in the isnet would be problematic.
Problem is that showing the context menu is done in two steps:
1) Set the cursor in LFUN_MOUSE_PRESS
2) Show the menu in GuiWorkArea::something()

BufferView::mouseSetCursor() is used with button1 and button3 so we need an 
additional boolean parameter for this. For button1, we definitly don't want to 
set the cursor inside a non editable inset. For button3 on the other hand we 
could push back the cursor slice temporarily pop it back once the context menu 
is escaped. Problem is that I don't know how to detect that the context menu is 
escaped. Maybe we just have to push it back in Cursor::fixIfBroken() and it 
will work automatically.

I'll let you play with this ;-)

Abdel.




Reply via email to