From 588ce1adb86f9a0e421f10206ae2e5fff3a561ce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Oct 2010 14:04:25 -0600 Subject: [PATCH] Drag 'n drop: Dont start drag if any keyboard modifiers are pressed --- src/calibre/gui2/library/views.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 40f74425c8..051f871e73 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -500,11 +500,13 @@ class BooksView(QTableView): # {{{ return QTableView.mousePressEvent(self, event) def mouseMoveEvent(self, event): - if not (event.buttons() & Qt.LeftButton) or self.drag_start_pos is None: - return - if (event.pos() - self.drag_start_pos).manhattanLength() \ - < QApplication.startDragDistance(): - return + if not (event.buttons() & Qt.LeftButton) or \ + self.drag_start_pos is None or \ + QApplication.keyboardModifiers() != Qt.NoModifier or \ + (event.pos() - self.drag_start_pos).manhattanLength() \ + < QApplication.startDragDistance(): + return QTableView.mouseMoveEvent(self, event) + index = self.indexAt(event.pos()) if not index.isValid(): return