Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #22
I couldn't figure out if that 16px difference between the dock height and the tile size is a constant or not, so it seems like using the Obj-C to to calculate the difference between the frame and the visibleScreen is the most reliable solution without needing assistive devices enabled. I think the reason the Obj-C utility might have been unreliable before and sometimes wouldn't detect the dock is that it was comparing
diffHeight != 0
which could fail due to floating point imprecision. I tried to fix this by comparingdiffHeight
anddiffWidth
toFLT_EPSILON
which is a very small, non-zero constant that should account for any weird floating point problems.Overall, I kept the main logic similar but added in checks needed for left/right dock support.
One case that seems a bit weird is that it appears when the dock is set to auto-hide, there's a small region used to detect the mouse-over that is 4 px tall for me. I'm not sure if this 4 px is a constant that we could account for when the dock is autohiding.
Tested on a two monitor setup in Terminal and iTerm. I will keep testing this out and see if I find any issues, but I thought I would put this PR up so others could take a look and test.