From 8e6e435c86fb311705423352c73b59843830a907 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Sat, 25 May 2024 19:47:27 -0500 Subject: [PATCH] Loading previous geometry and window state in a QTimer, so failures don't freeze the main thread/window during load --- src/windows/main_window.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/windows/main_window.py b/src/windows/main_window.py index d1e7247d9..184b76891 100644 --- a/src/windows/main_window.py +++ b/src/windows/main_window.py @@ -3439,14 +3439,14 @@ def __init__(self, *args): # Apply saved window geometry/state from settings if self.saved_geometry: try: - self.restoreGeometry(self.saved_geometry) + QTimer.singleShot(100, functools.partial(self.restoreGeometry, self.saved_geometry)) except Exception as e: - log.warning(f"Error restoring window geometry: {e}") + log.error(f"Error restoring window geometry: {e}") if self.saved_state: try: - self.restoreState(self.saved_state) + QTimer.singleShot(100, functools.partial(self.restoreState, self.saved_state)) except Exception as e: - log.warning(f"Error restoring window state: {e}") + log.error(f"Error restoring window state: {e}") # Save settings s.save()