Skip to content

Commit

Permalink
refactor: ratio always greater than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh committed Mar 29, 2024
1 parent 52b3a6e commit f5d457e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/wm.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ wm = WindowManager(
strict=True,
gap=2,
new_window_as_master=True,
affinity_index=lambda si: (5 if si.inch >= 24 else 0) + (5 if si.ratio < 2 else 0),
affinity_index=lambda si: (5 if si.inch >= 20 else 0) + (5 if si.ratio < 2 else 0),
),
Theme(
name="Mono",
layout_tiler=tilers.mono_layout_tiler,
strict=True,
affinity_index=lambda si: 10 if si.inch < 24 else 0,
affinity_index=lambda si: 10 if si.inch < 20 else 0,
),
Theme(
name="WideScreen Dwindle",
Expand All @@ -38,7 +38,7 @@ wm = WindowManager(
gap=2,
strict=True,
new_window_as_master=True,
affinity_index=lambda si: (5 if si.inch >= 24 else 0) + (5 if si.ratio > 2 else 0),
affinity_index=lambda si: (5 if si.inch >= 20 else 0) + (5 if si.ratio >= 2 else 0),
),
],
ignore_exe_names=[
Expand Down
2 changes: 1 addition & 1 deletion src/jigsawwm/w32/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_screen_info(self) -> screeninfo.Monitor:
monitor.height,
monitor.width_mm,
monitor.height_mm,
ratio=monitor.width / monitor.height,
ratio=max(monitor.width, monitor.height) / min(monitor.width, monitor.height),
is_primary=monitor.is_primary,
inch=round(math.sqrt(monitor.width_mm ** 2 + monitor.height_mm ** 2) / 25.4),
)
Expand Down
2 changes: 1 addition & 1 deletion src/jigsawwm/wm/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _consume_sync_queue(self):
traceback.print_exc()

def _sync(self, init=False, restrict=False) -> bool:
logger.warning("_sync")
# logger.warning("_sync")
virtdesk_state = self.virtdesk_state
# gather all manageable windows
manageable_windows = list(get_manageable_windows(self.check_force_managed))
Expand Down

0 comments on commit f5d457e

Please sign in to comment.