Skip to content

Conversation

@CCMurphy-dev
Copy link

Addresses issue #235 - windows with min/max size constraints (Terminal, Calculator, video players, etc.) are now handled gracefully in BSP layouts.

Implementation:

  • Detect frame constraints by comparing requested vs actual size after resize
  • Store detected min_size/max_size on window struct for layout calculations
  • Adjust BSP split ratios to give constrained windows enough space
  • Center undersized windows within their allocated node frame
  • Overlap oversized windows toward screen center (not toward edges)
  • Clamp manual/mouse resizes to detected min/max constraints

Safeguards:

  • Auto-rebalance triggers only once per window (on first constraint detection) - to avoid looping
  • Subsequent resizes skip rebalance, preventing refresh loops
  • Ratio adjustments clamped to 0.1-0.9 range to prevent extreme splits

Files changed:

  • src/window.h: Added min_size, max_size, has_size_constraints fields
  • src/window_manager.c: Constraint detection, positioning, and resize clamping
  • src/view.c: Ratio adjustment based on detected constraints

Addresses issue asmvik#235 - windows with min/max size constraints (Terminal,
Calculator, video players, etc.) are now handled gracefully in BSP layouts.

Implementation:
- Detect frame constraints by comparing requested vs actual size after resize
- Store detected min_size/max_size on window struct for layout calculations
- Adjust BSP split ratios to give constrained windows enough space
- Center undersized windows within their allocated node frame
- Overlap oversized windows toward screen center (not toward edges)
- Clamp manual/mouse resizes to detected min/max constraints

Safeguards:
- Auto-rebalance triggers only once per window (on first constraint detection)
- Subsequent resizes skip rebalance, preventing refresh loops
- Ratio adjustments clamped to 0.1-0.9 range to prevent extreme splits

Files changed:
- src/window.h: Added min_size, max_size, has_size_constraints fields
- src/window_manager.c: Constraint detection, positioning, and resize clamping
- src/view.c: Ratio adjustment based on detected constraints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant