mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix UI hanging with empty context menu (#3553)
This commit is contained in:
parent
898c91284b
commit
442ddb085a
1 changed files with 2 additions and 1 deletions
|
@ -381,7 +381,8 @@ class AnkiWebView(QWebEngineView):
|
||||||
m = QMenu(self)
|
m = QMenu(self)
|
||||||
self._maybe_add_copy_action(m)
|
self._maybe_add_copy_action(m)
|
||||||
gui_hooks.webview_will_show_context_menu(self, m)
|
gui_hooks.webview_will_show_context_menu(self, m)
|
||||||
m.popup(QCursor.pos())
|
if m.actions():
|
||||||
|
m.popup(QCursor.pos())
|
||||||
|
|
||||||
def _maybe_add_copy_action(self, menu: QMenu) -> None:
|
def _maybe_add_copy_action(self, menu: QMenu) -> None:
|
||||||
if self.hasSelection():
|
if self.hasSelection():
|
||||||
|
|
Loading…
Reference in a new issue