feat(window_manager): add get_display_topology_signature for dynamic monitor and resolution change detection

This commit is contained in:
2026-09-08 23:46:30 +02:00
parent 59ba4b988f
commit 0033fbce9b
+10
View File
@@ -349,6 +349,16 @@ class WindowManager:
user32.EnumDisplayMonitors(0, None, MONITORENUMPROC(enum_mon_proc), 0)
return monitors
@classmethod
def get_display_topology_signature(cls) -> tuple:
"""
Returns a hashable signature representing current displays, resolutions, and work areas.
Used to detect dynamic monitor connection, disconnection, or resolution adjustments.
"""
monitors = cls.get_monitors()
vd = cls.get_virtual_desktop_bounds()
return (vd, tuple((m.handle, m.is_primary, m.rect, m.work_area) for m in monitors))
@classmethod
def get_floor_y_at(cls, x: float, cat_height: int) -> float:
"""