From 5ccc6304e36d48190318ba1c9c803dbbd8a3f654 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 26 Jan 2025 17:31:27 +1100 Subject: [PATCH] Fix drag&drop on some Linux systems Thanks to Ab_Bc: https://forums.ankiweb.net/t/image-occlusion-not-working-jan-2025/54523/17 Closes #3767 --- qt/aqt/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index fa1998f2b..84b17c9ed 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -1552,7 +1552,8 @@ class EditorWebView(AnkiWebView): extended = self._wantsExtendedPaste() mime = evt.mimeData() assert mime is not None - cursor_pos = self.mapFromGlobal(QCursor.pos()) + evt_pos = evt.position() + cursor_pos = QPoint(int(evt_pos.x()), int(evt_pos.y())) if evt.source() and mime.hasHtml(): # don't filter html from other fields