diff --git a/catser/window_manager.py b/catser/window_manager.py index deb7a0e..5253686 100644 --- a/catser/window_manager.py +++ b/catser/window_manager.py @@ -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: """