summaryrefslogtreecommitdiffstats
path: root/deluge/ui/gtk3/common.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2021-09-02 20:17:09 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2021-09-14 21:56:03 +0100
commit2a312159b9374e4a7f4a7cc1a05e08e4e59c0ca8 (patch)
treee9a19418b18fc525a707236ad3c49b836804b1bc /deluge/ui/gtk3/common.py
parentcb75192df491fd97d3c76d9d2a5a36d2932b8ac7 (diff)
downloaddeluge-2a312159b9374e4a7f4a7cc1a05e08e4e59c0ca8.tar.gz
deluge-2a312159b9374e4a7f4a7cc1a05e08e4e59c0ca8.tar.bz2
deluge-2a312159b9374e4a7f4a7cc1a05e08e4e59c0ca8.zip
[GTKUI] Fix unhandled error with empty clipboard
If the primary clipboard was empty the fallback resulted in an unhandled error due to missing arguments. Fixed by using SELECTION_PRIMARY as fallback clipboard
Diffstat (limited to 'deluge/ui/gtk3/common.py')
-rw-r--r--deluge/ui/gtk3/common.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/deluge/ui/gtk3/common.py b/deluge/ui/gtk3/common.py
index 743417284..e7b46c8d5 100644
--- a/deluge/ui/gtk3/common.py
+++ b/deluge/ui/gtk3/common.py
@@ -16,7 +16,7 @@ import shutil
import sys
import six.moves.cPickle as pickle # noqa: N813
-from gi.repository.Gdk import SELECTION_CLIPBOARD, Display
+from gi.repository.Gdk import SELECTION_CLIPBOARD, SELECTION_PRIMARY, Display
from gi.repository.GdkPixbuf import Colorspace, Pixbuf
from gi.repository.GLib import GError
from gi.repository.Gtk import (
@@ -395,8 +395,8 @@ def listview_replace_treestore(listview):
def get_clipboard_text():
text = (
- Clipboard.get(selection=SELECTION_CLIPBOARD).wait_for_text()
- or Clipboard.get().wait_for_text()
+ Clipboard.get(SELECTION_CLIPBOARD).wait_for_text()
+ or Clipboard.get(SELECTION_PRIMARY).wait_for_text()
)
if text:
return text.strip()