mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 11:37:47 +01:00
This commit fixes a bug that most Window Management extension commands won't work if you: 1. operate the focused window from another display 2. and they are adjacent To reproduce this: say you have 2 displays 1. Put the focused window on a non-main display, maximize the window 2. Move the mourse to the main display, making it the active display 3. Launch Coco, then execute the `TopHalf` command The focused window will be moved to the main display, while it should stay in the non-main display. The root cause of the issue is that the previous implementation of `intersects()` didn't handle an edge case correctly, adjavent rectangles should not be considered overlapping. This commit replaces the buggy implementation with the `CGRectIntersectsRect()` function from macOS core graphics library.