Add option to move resized window to the display under cursor.#1644
Add option to move resized window to the display under cursor.#1644rxhanson merged 1 commit intorxhanson:mainfrom
Conversation
rxhanson
left a comment
There was a problem hiding this comment.
Thanks for contributing!
I'll take a look at those layout issues - thanks for pointing that out.
| return UsableScreens(currentScreen: sourceScreen, adjacentScreens: adjacentScreens, numScreens: screens.count, screensOrdered: screensOrdered) | ||
| } | ||
|
|
||
| func detectScreensAtCursor() -> UsableScreens? { |
There was a problem hiding this comment.
Let's remove all of the comments in this function.
| screens = UsableScreens(currentScreen: screen, numScreens: 1) | ||
| } else { | ||
| screens = screenDetection.detectScreens(using: frontmostWindowElement) | ||
| // Use cursor position or window position based on user preference |
There was a problem hiding this comment.
Let's remove this comment as well, and change this if else to a ternary:
screens = Defaults.useCursorScreenDetection.enabled
? screenDetection.detectScreensAtCursor
: screenDetection.detectScreens(using: frontmostWindowElement)
|
I finally had a chance to test this one out, and we'll also want to properly handle next/prev display commands. With your changes, executing those repeatedly will land the window only on the other display and it won't go back. I think my expected behavior would be for those to not use the cursor display as the main display. |
1da0786 to
0bba832
Compare
|
I went ahead and made the changes I had recommended. Because the actions that move to other displays weren't ironed out, I left the checkbox hidden by default (only enabled via Terminal command). If you get a chance to fix up the other display edge cases, make another PR and we can add the checkbox back in. |
Divvy has a nice feature where it moves the resized window to the display under cursor. I added a similar feature that's opt-in.
PS: Xcode 26 changed some positioning and is giving a few warnings. I didn't know how you'd like to handle it, so I kept it as it is (you can see the buttons are broken on the image above; same on the initial screen asking for the shortcut profile).