Skip to content

Add Center zone for keyboard window snapping#2134

Closed
leonbreukelman wants to merge 2 commits intopop-os:masterfrom
leonbreukelman:feature/center-tiling-zone
Closed

Add Center zone for keyboard window snapping#2134
leonbreukelman wants to merge 2 commits intopop-os:masterfrom
leonbreukelman:feature/center-tiling-zone

Conversation

@leonbreukelman
Copy link

Summary

  • Adds TiledCorners::Center — a horizontally centered, full-height column (50% width)
  • Geometry: positioned at 25% from left edge, full height minus gaps
  • Direction transitions from Center: Left → Left, Right → Right, Up → Maximize, Down → Bottom
  • Maps TilingZone::Center from cosmic-settings-config to the new variant

Primarily useful on ultrawide monitors where the existing left/right halves are too wide for focused single-window work (terminals, editors, reading).

Dependencies

Example keybinding

(modifiers: [Super, Ctrl], key: "c"): TileWindow(Center),

Test plan

  • Build succeeds
  • Center zone positions window at horizontal center with 50% width, full height
  • Direction keys from Center transition correctly (Left/Right to halves, Up to maximize, Down to bottom)
  • Existing 8-zone behavior unchanged

jlaustill and others added 2 commits January 20, 2026 15:28
Implement handler for the TileWindow action that snaps floating windows
to screen edges and corners (8 zones: Top, TopRight, Right, BottomRight,
Bottom, BottomLeft, Left, TopLeft).

- Add TileWindow action handler in input/actions.rs
- Add Shell::tile_window() method in shell/mod.rs
- Add FloatingLayout::tile_window() method in shell/layout/floating/mod.rs

The implementation reuses the existing TiledCorners enum and animation
system for smooth transitions.

Depends on: pop-os/cosmic-settings-daemon#124

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds TiledCorners::Center that snaps a floating window to a
horizontally centered, full-height column (50% width). This is
especially useful on ultrawide monitors where left/right halves
are too wide for focused single-window work.

Geometry: centered at 25% from left edge, 50% screen width,
full height (minus gaps).

Direction transitions from Center:
- Left  → Left half
- Right → Right half
- Up    → Maximize (already full height, expand to full width)
- Down  → Bottom half

Extends the TileWindow handler from #2009.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 24, 2026 16:55
@mmstick
Copy link
Member

mmstick commented Feb 24, 2026

The pull request template is not optional. You must check each item on the list before creating a pull request.

This comment was marked as spam.

@leonbreukelman
Copy link
Author

Build verified locally with cargo check on Rust 1.90.0. Used a [patch] section to point cosmic-settings-config at the local checkout (with the Center variant from pop-os/cosmic-settings-daemon#130). Compiles clean — no new warnings.

@leonbreukelman
Copy link
Author

Build and runtime verified. Tested in nested compositor (COSMIC_BACKEND=winit) with a patched cosmic-settings-config. Center zone snaps correctly to a horizontally centered, full-height column (50% width). Left/Right zones also tested for comparison — all working as expected.

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.

4 participants