]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
Prevent zombie processes (#8774)
[lyx.git] / src / Text3.cpp
index 6e6e9e6f3b57fdabc296757dce530de5d6e7495d..34f6af1e5b48448ee1b1b454043c5daacb63bcc8 100644 (file)
@@ -648,12 +648,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                // provide it with two different cursors.
                                Cursor dummy = cur;
                                dummy.pos() = dummy.pit() = 0;
-                               if (cur.bv().checkDepm(dummy, cur)) {
+                               if (cur.bv().checkDepm(dummy, cur))
                                        cur.forceBufferUpdate();
-                                       // DEPM may have requested a screen update
-                                       cur.screenUpdateFlags(
-                                               cur.screenUpdate() | dummy.screenUpdate());
-                               }
                        }
                }
                break;
@@ -679,12 +675,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                Cursor dummy = cur;
                                dummy.pos() = cur.lastpos();
                                dummy.pit() = cur.lastpit();
-                               if (cur.bv().checkDepm(dummy, cur)) {
+                               if (cur.bv().checkDepm(dummy, cur))
                                        cur.forceBufferUpdate();
-                                       // DEPM may have requested a screen update
-                                       cur.screenUpdateFlags(
-                                               cur.screenUpdate() | dummy.screenUpdate());
-                               }
                        }
                }
                break;
@@ -867,12 +859,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                // provide it with two different cursors.
                                Cursor dummy = cur;
                                dummy.pos() = dummy.pit() = 0;
-                               if (cur.bv().checkDepm(dummy, cur)) {
+                               if (cur.bv().checkDepm(dummy, cur))
                                        cur.forceBufferUpdate();
-                                       // DEPM may have requested a screen update
-                                       cur.screenUpdateFlags(
-                                               cur.screenUpdate() | dummy.screenUpdate());
-                               }
                        }
                }
                break;
@@ -921,12 +909,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                Cursor dummy = cur;
                                dummy.pos() = cur.lastpos();
                                dummy.pit() = cur.lastpit();
-                               if (cur.bv().checkDepm(dummy, cur)) {
+                               if (cur.bv().checkDepm(dummy, cur))
                                        cur.forceBufferUpdate();
-                                       // DEPM may have requested a screen update
-                                       cur.screenUpdateFlags(
-                                               cur.screenUpdate() | dummy.screenUpdate());
-                               }
                        }
                }
                break;
@@ -1242,13 +1226,16 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                // without argument?
                string const arg = to_utf8(cmd.argument());
                if (arg.empty()) {
+                       bool tryGraphics = true;
                        if (theClipboard().isInternal())
                                pasteFromStack(cur, bv->buffer().errorList("Paste"), 0);
-                       else if (theClipboard().hasGraphicsContents() 
-                                    && !theClipboard().hasTextContents())
+                       else if (theClipboard().hasTextContents()) {
+                               if (pasteClipboardText(cur, bv->buffer().errorList("Paste"),
+                                                      true, Clipboard::AnyTextType))
+                                       tryGraphics = false;
+                       }
+                       if (tryGraphics && theClipboard().hasGraphicsContents())
                                pasteClipboardGraphics(cur, bv->buffer().errorList("Paste"));
-                       else
-                               pasteClipboardText(cur, bv->buffer().errorList("Paste"), true);
                } else if (isStrUnsignedInt(arg)) {
                        // we have a numerical argument
                        pasteFromStack(cur, bv->buffer().errorList("Paste"),