Skip to content

Commit 208c84c

Browse files
committed
Initialize super class with parent if available
When initializing the Screensaver class we should initialize it with the parent class because when the parent is deleted, so it the Screensaver. Setting the parent/child relation also coordinates the children according to the parent, handles geometry and unhandled mouse/keyboard events that should propagate to the parent.
1 parent 44e74d4 commit 208c84c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎BlocksScreen/screensaver.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ class ScreenSaver(QtCore.QObject):
1010
touch_blocked: bool = False
1111

1212
def __init__(self, parent) -> None:
13-
super().__init__()
13+
if parent:
14+
super().__init__(parent)
15+
else:
16+
super().__init__()
1417

1518
self.screensaver_config = parent.config.get_section(
1619
"screensaver", fallback=None

0 commit comments

Comments
 (0)