From 49a1de252ac7cb1c2413b4ddf3626772b4e9b6ad Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Oct 2016 13:19:47 +0530 Subject: [PATCH] Workaround for some linux systems that appear to have a Qt theme/input method? plugin installed that generated QResizeEvents with type set to KeyPress --- src/calibre/gui2/complete2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 9cc8d3414b..fb52a3246b 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -211,7 +211,10 @@ class Completer(QListView): # {{{ # self.debug_event(e) if etype == e.KeyPress: - key = e.key() + try: + key = e.key() + except AttributeError: + return QObject.eventFilter(self, obj, e) if key == Qt.Key_Escape: self.hide() e.accept()