diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 356963313..65401a2fa 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -1002,19 +1002,16 @@ def no_arg_trigger(func: Callable) -> Callable: return pyqtSlot()(func) # type: ignore -def is_zoom_event(evt: QEvent) -> bool: - """If the event will trigger zoom. +def is_gesture_or_zoom_event(evt: QEvent) -> bool: + """If the event is a gesture and/or will trigger zoom. - Includes zoom by pinching, Ctrl-scrolling, and Meta-scrolling, - where scrolling may be triggered by mouse wheel or gesture. + Includes zoom by pinching, and Ctrl-scrolling on Win and Linux. """ return isinstance(evt, QNativeGestureEvent) or ( isinstance(evt, QWheelEvent) - and ( - (is_mac and KeyboardModifiersPressed().meta) - or KeyboardModifiersPressed().control - ) + and not is_mac + and KeyboardModifiersPressed().control ) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 12e73f25b..575338fad 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -13,7 +13,7 @@ from anki.utils import is_lin, is_mac, is_win from aqt import colors, gui_hooks from aqt.qt import * from aqt.theme import theme_manager -from aqt.utils import askUser, is_zoom_event, openLink, showInfo, tr +from aqt.utils import askUser, is_gesture_or_zoom_event, openLink, showInfo, tr serverbaseurl = re.compile(r"^.+:\/\/[^\/]+") @@ -260,7 +260,7 @@ class AnkiWebView(QWebEngineView): self._disable_zoom = True def eventFilter(self, obj: QObject, evt: QEvent) -> bool: - if self._disable_zoom and is_zoom_event(evt): + if self._disable_zoom and is_gesture_or_zoom_event(evt): return True if (