Allow wheel events on focused boxes when window is inactive

This commit is contained in:
kemal
2026-08-28 02:13:51 +03:00
parent cd419558fd
commit 21e28f621e
2 changed files with 14 additions and 1 deletions
+3 -1
View File
@@ -207,7 +207,9 @@ class WheelGuard(QObject):
"""
def eventFilter(self, box, event):
if event.type() == QEvent.Type.Wheel and not box.hasFocus():
win = box.window()
focused = box.hasFocus() or (win is not None and win.focusWidget() is box)
if event.type() == QEvent.Type.Wheel and not focused:
# Refused rather than swallowed. An unaccepted wheel event carries
# on up the parents to the scroll area, so the page still moves.
event.ignore()