Skip to content

Add move window to specific display by number#1735

Merged
rxhanson merged 1 commit into
rxhanson:mainfrom
LucasZdv:feature/specific-display
Apr 2, 2026
Merged

Add move window to specific display by number#1735
rxhanson merged 1 commit into
rxhanson:mainfrom
LucasZdv:feature/specific-display

Conversation

@LucasZdv

@LucasZdv LucasZdv commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for moving the focused window directly to a specific display (1–9) using keyboard shortcuts, instead of cycling through displays sequentially with Next/Previous Display.

This addresses the feature requested in #199, which was closed without the specific-display-by-number functionality being implemented.

  • New WindowAction cases: displayOne through displayNine
  • New SpecificDisplayCalculation class (modeled after NextPrevDisplayCalculation)
  • Screens are sorted by x-coordinate (left to right); if the target display is not connected, the action is silently ignored
  • Shortcuts are configurable via Terminal commands (no UI changes), as suggested by @rxhanson in Move window to an specific Display #199

Configuration example

defaults write com.knollsoft.Rectangle displayOne -dict-add keyCode -float 18 modifierFlags -float 1835305
defaults write com.knollsoft.Rectangle displayTwo -dict-add keyCode -float 19 modifierFlags -float 1835305

Motivation

As a user with 4+ monitors, cycling through displays with Next/Previous is inefficient. This feature allows jumping directly to any display by number, which is significantly faster in multi-monitor setups.

I am also a Rectangle Pro license holder and would love to see this feature included in Pro as well.

Test plan

  • Tested with 4 displays on macOS
  • Verified shortcuts work correctly (window moves to the expected display)
  • Verified that targeting a disconnected display is handled gracefully (no-op)
  • Verified that attemptMatchOnNextPrevDisplay setting is respected

Adds support for moving windows directly to a specific display by number,
instead of cycling through displays sequentially with Next/Previous Display.

Screens are sorted by their x-coordinate position (left to right) and each
action maps to a 0-based index in that ordered list. If the target display
is not connected, the action is silently ignored.

New actions: displayOne through displayNine, configurable via Terminal:

  defaults write com.knollsoft.Rectangle displayOne \
    -dict-add keyCode -float 18 modifierFlags -float 1835305

This addresses the feature request in rxhanson#199 for users with 3+ monitors
who need to jump directly to a specific display without cycling.

I am a Rectangle Pro license holder and would appreciate this feature
being included in Rectangle Pro as well.
@rxhanson

rxhanson commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Thanks for contributing! Looks good.

This is actually configurable in Rectangle Pro using the Custom Size & Position functionality, but it makes sense to have this rolled in there as well.

@rxhanson rxhanson merged commit 075883a into rxhanson:main Apr 2, 2026
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.

2 participants