window_state: annotate silent excepts
Both hyprctl-path guards in window_state (hyprctl_main_window() JSON parse, save_main_window_state() full flow) now explain why the failure is absorbed instead of raised. No behavior change.
This commit is contained in:
parent
b63341fec1
commit
585979a0d1
@ -160,6 +160,10 @@ class WindowStateController:
|
|||||||
continue
|
continue
|
||||||
return c
|
return c
|
||||||
except Exception:
|
except Exception:
|
||||||
|
# hyprctl unavailable (non-Hyprland session), timed out,
|
||||||
|
# or produced invalid JSON. Caller treats None as
|
||||||
|
# "no Hyprland-visible main window" and falls back to
|
||||||
|
# Qt's own geometry tracking.
|
||||||
pass
|
pass
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -207,6 +211,9 @@ class WindowStateController:
|
|||||||
# When tiled, intentionally do NOT touch floating_geometry --
|
# When tiled, intentionally do NOT touch floating_geometry --
|
||||||
# preserve the last good floating dimensions.
|
# preserve the last good floating dimensions.
|
||||||
except Exception:
|
except Exception:
|
||||||
|
# Geometry persistence is best-effort; swallowing here
|
||||||
|
# beats crashing closeEvent over a hyprctl timeout or a
|
||||||
|
# setting-write race. Next save attempt will retry.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def restore_main_window_state(self) -> None:
|
def restore_main_window_state(self) -> None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user