Spectacle: When auto hide dock is positioned to left, Spectacle leaves a gap at the left screen edge

Created on 15 Mar 2016  路  15Comments  路  Source: eczarny/spectacle

This does not happen for the bottom of the screen when you position the doc to the bottom.

Steps to replicate:

  1. Open system preferences/dock
  2. Tick box to "Automatically hide and show the Dock"
  3. Change "Position on screen" to "left"
  4. Select "Left Half" on Spectacle and you should see about a 5 pixel gap between the left edge of the screen and the window you have just moved.
  5. Change "Position on screen" to "bottom"
  6. Select "Left Half" again and you will see the window move over to fill that gap.

The same issue exists for the right side if you put the dock on the right, but the problem doesn't happen when the dock is position to the bottom and you choose "Bottom half"

Most helpful comment

Dirty fix

$ git diff -U0
diff --git a/Spectacle/Sources/SpectacleWindowPositionManager.m b/Spectacle/Sources/SpectacleWindowPositionManager.m
index ee2b9d2..adf04d4 100644
--- a/Spectacle/Sources/SpectacleWindowPositionManager.m
+++ b/Spectacle/Sources/SpectacleWindowPositionManager.m
@@ -72,0 +73,10 @@
+
+    if (visibleFrameOfSourceScreen.origin.x == 4) {
+      visibleFrameOfSourceScreen.size.width += visibleFrameOfSourceScreen.origin.x;
+      visibleFrameOfSourceScreen.origin.x = 0;
+    }
+
+    if (visibleFrameOfDestinationScreen.origin.x == 4) {
+      visibleFrameOfDestinationScreen.size.width += visibleFrameOfDestinationScreen.origin.x;
+      visibleFrameOfDestinationScreen.origin.x = 0;
+    }

All 15 comments

Same thing happens also with the dock on the bottom of the screen. When autohide is on, moving windows to the left or right edge of the scree leaves a small gap on top of the window.

This gap is explicitly added by OS X. You'll notice that if you move the hidden Dock to the bottom of the display the gap is still visible on the bottom edge.

@eczarny Oh right, you are! I guess it's just not as noticeable at the bottom.

Ok so the trouble is, if I was manually resizing windows I would resize by a few pixels on the opposite side and then move the window over to cover that gap. However it seems that Spectacle was created for the purpose of removing the manual part of window resizing. When somebody selects left half I don't think they expect "left half except for a columns of pixels on the left edge." Thoughts?

I have this issue as well.

Dirty fix

$ git diff -U0
diff --git a/Spectacle/Sources/SpectacleWindowPositionManager.m b/Spectacle/Sources/SpectacleWindowPositionManager.m
index ee2b9d2..adf04d4 100644
--- a/Spectacle/Sources/SpectacleWindowPositionManager.m
+++ b/Spectacle/Sources/SpectacleWindowPositionManager.m
@@ -72,0 +73,10 @@
+
+    if (visibleFrameOfSourceScreen.origin.x == 4) {
+      visibleFrameOfSourceScreen.size.width += visibleFrameOfSourceScreen.origin.x;
+      visibleFrameOfSourceScreen.origin.x = 0;
+    }
+
+    if (visibleFrameOfDestinationScreen.origin.x == 4) {
+      visibleFrameOfDestinationScreen.size.width += visibleFrameOfDestinationScreen.origin.x;
+      visibleFrameOfDestinationScreen.origin.x = 0;
+    }

This hasn't been resolved yet? @twlz0ne, did this ever make it into a PR?

@cdbattags Unfortunately I don't have any plans on merging a change to address this. This has been the behavior of OS X for as long as I've been working on Spectacle (likely longer) and I have no intentions to subvert the behavior.

@eczarny Is the gap useful in some way?

@gerrywastaken OS X adds it so that windows don't overlap with the area that will raise the hidden Dock.

@eczarny but if I manually cover that area with a window, the doc still shows when I move my mouse to that area. Items at the edge of windows (e.g. scrollbars) are still easily accessible as the area where the Dock is popped out is very small. I can see why Apple made this decision when maximising a window, but I think it makes far less sense when you are assigning windows into much smaller sections, where space really matters.

@cdbattags

No PR yet.

The above code only works for Dock auto-hide on the left side.
If you want to remove gap from right side:

if dock hide on right side

    if screen count > 1
        if is the right screen
            move dock to left screen
            set frame size // gap has been removed from current screen
            resotre dock settings

    else
        set auto-hide to bottom
        set frame size // gap still exist on the bottom, but better than on the right, I think
        resotre dock settings

Such a strange solution, I'm not sure that is appropriate to make a PR, maybe someone has a normal solution?

@twlz0ne, Unfortunately @eczarny hash mentioned that he is unlikely to merge a pull request for this change: https://github.com/eczarny/spectacle/issues/555#issuecomment-243866307

Hey 鈥斅燿id anyone come up with an easy solution for this?

For me (and I assume the majority), I have the dock on the bottom and it seems that the above code only works for left / right. Does anyone have the code to add 4 pixels to the window height (not width) instead?

How can I implement @twlz0ne solution, please help... This annoys the heck out of me! Ty

@JuanSebastanCho I pushed a commit to my forked repo https://github.com/twlz0ne/spectacle/commit/4d2645ed976eefc9abafc5ef8ddddb2fa8a79bf0, It does not look pretty, bu work well on my computer.

@eczarny would you mind taking a look?

Was this page helpful?
0 / 5 - 0 ratings