Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Ability to snap windows #22

Closed
MrKai77 opened this issue Sep 4, 2023 · 2 comments · Fixed by #29
Closed

✨ Ability to snap windows #22

MrKai77 opened this issue Sep 4, 2023 · 2 comments · Fixed by #29
Assignees
Labels

Comments

@MrKai77
Copy link
Owner

MrKai77 commented Sep 4, 2023

Feature Request Description

This feature would allow users to easily resize windows to specific positions without needing to press a single key on their keyboard.

Screenshots

No response

Additional Context

No response

@MrKai77 MrKai77 added the Feature label Sep 4, 2023
MrKai77 added a commit that referenced this issue Sep 4, 2023
@MrKai77
Copy link
Owner Author

MrKai77 commented Sep 4, 2023

Still very POC, but it works most of the time!

Loop-snapping-demo.mp4

@MrKai77 MrKai77 self-assigned this Sep 4, 2023
MrKai77 added a commit that referenced this issue Sep 4, 2023
- To resize a window to quarters, drag it closer to the corner of the screen
- `draggingWindow` is now always set to `nil` when `leftMouseUp` happens
@MrKai77
Copy link
Owner Author

MrKai77 commented Sep 8, 2023

Status update: Window snapping works as intended, but monitoring the mouse dragging using NSEvent.addGlobalMonitorForEvents also has an unwanted side-effect: the user can't click the menubar item! I may need to change how the mouse events are processed, kind of like how KeybindMonitor works, where it uses CGEvent.tapCreate instead of NSEvent.addGlobalMonitorForEvents.

MrKai77 added a commit that referenced this issue Sep 8, 2023
MrKai77 added a commit that referenced this issue Sep 8, 2023
@MrKai77 MrKai77 linked a pull request Sep 9, 2023 that will close this issue
MrKai77 added a commit that referenced this issue Sep 9, 2023
MrKai77 added a commit that referenced this issue Sep 13, 2023
`EventMonitor` has been renamed to `CGEventMonitor`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant