Browse Source

bugfix: check hasFocus() when handling clipboard change

When copying the preview image, other tabs should check if they have the focus.

Signed-off-by: Le Tan <[email protected]>
Le Tan 9 years ago
parent
commit
5a097421e1
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/vmdedit.cpp

+ 3 - 0
src/vmdedit.cpp

@@ -516,6 +516,9 @@ void VMdEdit::handleSelectionChanged()
 
 void VMdEdit::handleClipboardChanged(QClipboard::Mode p_mode)
 {
+    if (!hasFocus()) {
+        return;
+    }
     if (p_mode == QClipboard::Clipboard) {
         QClipboard *clipboard = QApplication::clipboard();
         const QMimeData *mimeData = clipboard->mimeData();