]> git.lyx.org Git - features.git/blobdiff - src/Text3.cpp
Move special handling of paste function from InsetCollapsable to InsetText
[features.git] / src / Text3.cpp
index fe8b508b1676c7e4e1582a02dbe8739eac4de2da..5c726f97c9a140cfad3b906a778a770175efd917 100644 (file)
@@ -512,6 +512,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 {
        LYXERR(Debug::ACTION, "Text::dispatch: cmd: " << cmd);
 
+       // Dispatch if the cursor is inside the text. It is not the
+       // case for context menus (bug 5797).
+       if (cur.text() != this) {
+               cur.undispatched();
+               return;
+       }
+
        BufferView * bv = &cur.bv();
        TextMetrics * tm = &bv->textMetrics(this);
        if (!tm->contains(cur.pit())) {