> Try again. Now, when there is a selection, the context menu is always > the one of the inset containing the selection.
//If there is a selection, return the containing inset menu 537 if (d->cursor_.selection()) 538 return d->cursor_.inset().contextMenu(*this, x, y); > If you right-click the button of the Note, the dissolve item is always > disabled. Related to this: choosing the dissolve item of the context > menu of a subfloat will dissolve the outer float. Probably caused by > an inset-dissolve command instead of a next-inset-dissolve command. (I > know there has been discussion on this point before). This patch will solve the problem of bug 5156 discussed before. Selecting the character at position 6 gives a selectionEnd at pos 7 and a selectionBegin at pos 6. Checking for the current selection using <= and >= always results in two characters being marked as selection. This is wrong, so I changed <= into <. This probably is the case at a lot more places in the code. Index: src/Text3.cpp =================================================================== --- src/Text3.cpp (revision 26147) +++ src/Text3.cpp (working copy) @@ -1184,7 +1185,7 @@ // Don't do anything if we right-click a // selection, a context menu will popup. if (bvcur.selection() && cur >= bvcur.selectionBegin() - && cur <= bvcur.selectionEnd()) { + && cur < bvcur.selectionEnd()) { cur.noUpdate(); return; About the dissolve inset items and stuff. I added this to the code and it solves the problem (a bit), but I have to try what the exact behaviour is. @@ -2103,6 +2105,14 @@ } else { enable = !isMainText(cur.bv().buffer()) && cur.inset().nargs() == 1; + if( !enable ) + { + Inset * next_inset = cur.nextInset(); + if (next_inset) { + enable = next_inset->nargs() == 1; + } + } + } break;