8

Keep Getting this error when using PyQt5's clipboard.setMimeData()

QXcbClipboard::setMimeData: Cannot set X11 selection owner

def copy(index, app):
    clipboard = app.clipboard()
    Mode = clipboard.Clipboard

    initialMimeData = clipboard.mimeData(mode = Mode)

    import pyautogui
    pyautogui.hotkey('ctrl', 'c')

    mimeData = clipboard.mimeData(mode = Mode)
    clipboards[index-1]["Data"] = mimeData
    clipboard.setMimeData(initialMimeData, mode = Mode) #getting the error here

I'm running this on Ubuntu 16.04. Why do I get this issue and how do I fix it?

DejaVu_Loop
  • 305
  • 2
  • 10
  • Seems like a more general issue than implied here. No need for python to experience this. I don't use python at all and seeing this error in `konsole` when trying to select text with mouse. – arielf Apr 29 '18 at 04:56
  • @arielf Also I experienced it in a python-free konsole session. Konsole won't inject the selection into the clipboard, I don't know, why. – peterh Apr 17 '19 at 13:18
  • Did you already try adding a timeout? – adabru Feb 03 '23 at 14:05

0 Answers0