From a7ae71e41f7530069b6a073440fe3b20b51b9f50 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Feb 2016 17:39:37 +0530 Subject: [PATCH] Edit Book: Fix context menu positioning in code editor There was a slight offset in the positioning caused by calculating the position w.r.t. to the widget instead of the viewport. --- src/calibre/gui2/tweak_book/editor/widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/widget.py b/src/calibre/gui2/tweak_book/editor/widget.py index ad424a4216..519b010384 100644 --- a/src/calibre/gui2/tweak_book/editor/widget.py +++ b/src/calibre/gui2/tweak_book/editor/widget.py @@ -561,7 +561,7 @@ class Editor(QMainWindow): m.addMenu(cm) if self.syntax == 'html': m.addAction(actions['multisplit']) - m.exec_(self.editor.mapToGlobal(pos)) + m.exec_(self.editor.viewport().mapToGlobal(pos)) def goto_sourceline(self, *args, **kwargs): return self.editor.goto_sourceline(*args, **kwargs)