Skip to content

Comments

Handle TileWindow action for keyboard window snapping#2009

Open
jlaustill wants to merge 1 commit intopop-os:masterfrom
jlaustill:feature/tile-window-handler
Open

Handle TileWindow action for keyboard window snapping#2009
jlaustill wants to merge 1 commit intopop-os:masterfrom
jlaustill:feature/tile-window-handler

Conversation

@jlaustill
Copy link

@jlaustill jlaustill commented Jan 20, 2026

Summary

  • Add handler for TileWindow(TilingZone) action that snaps floating windows to screen edges and corners
  • Maps TilingZone from cosmic-settings-config to existing TiledCorners enum
  • Adds Shell::tile_window() and FloatingLayout::tile_window() methods
  • Reuses existing animation system for smooth 200ms ease-in-out transitions

Dependencies

Test plan

  • Build succeeds
  • Tested all 8 zones with custom keybindings:
    • Halves: Top, Bottom, Left, Right
    • Corners: TopLeft, TopRight, BottomLeft, BottomRight
  • Animation plays correctly
  • Works only on floating windows (as expected)

Example keybindings

{
    (modifiers: [Super, Ctrl], key: "Left"): TileWindow(Left),
    (modifiers: [Super, Ctrl], key: "Right"): TileWindow(Right),
    (modifiers: [Super, Ctrl], key: "Up"): TileWindow(Top),
    (modifiers: [Super, Ctrl], key: "Down"): TileWindow(Bottom),
    (modifiers: [Ctrl, Shift], key: "Left"): TileWindow(TopLeft),
    (modifiers: [Ctrl, Shift], key: "Right"): TileWindow(TopRight),
    (modifiers: [Ctrl, Super, Alt], key: "Left"): TileWindow(BottomLeft),
    (modifiers: [Ctrl, Super, Alt], key: "Right"): TileWindow(BottomRight),
}

🤖 Generated with Claude Code
Kooha-2026-01-20-15-32-59.webm

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>
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