-
Notifications
You must be signed in to change notification settings - Fork 47
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
Multiple displays (monitors) issues #106
Comments
I think I'm having the same issue you're describing. Clicking the upper left corner of single window on my top monitor registers as clicking one of the stack icons, even though there aren't any, and so it moves my mouse focus. For example if I have a chrome window on my top monitor and I click the "back" button, I can see this in the logs:
which move focus away from chrome instead of "clicking" back. Seems to be the same issue as #100 (comment) as well. |
@hamir-suspect, @acdifran, @pomdtr Can you try following fix? diff --git a/stackline/stack.lua b/stackline/stack.lua
index a664063..0977a60 100644
--- a/stackline/stack.lua
+++ b/stackline/stack.lua
@@ -66,32 +66,24 @@ function Stack:deleteAllIndicators() -- {{{
end -- }}}
function Stack:getWindowByPoint(p)
- if p.x < 0 or p.y < 0 then
- -- FIX: https://github.com/AdamWagner/stackline/issues/62
- -- NOTE: Window indicator frame coordinates are relative to the window's screen.
- -- So, if click point has negative X or Y vals, then convert its coordinates
- -- to relative to the clicked screen before comparing to window indicator frames.
- -- TODO: Clean this up after fix is confirmed
+ -- Get the screen with frame that contains point 'p'
+ local function findClickedScreen(_p) -- {{{
+ return table.unpack(
+ u.filter(hs.screen.allScreens(), function(s)
+ return _p:inside(s:frame())
+ end)
+ )
+ end -- }}}
- -- Get the screen with frame that contains point 'p'
- local function findClickedScreen(_p) -- {{{
- return table.unpack(
- u.filter(hs.screen.allScreens(), function(s)
- return _p:inside(s:frame())
- end)
- )
- end -- }}}
-
- local clickedScren = findClickedScreen(p)
- p = clickedScren
- and clickedScren:absoluteToLocal(p)
- or p
- end
+ local clickedScreen = findClickedScreen(p)
+ p = clickedScreen
+ and clickedScreen:absoluteToLocal(p)
+ or p
return table.unpack(
u.filter(self.windows, function(w)
local indicatorFrame = w.indicator and w.indicator:canvasElements()[1].frame
- if not indicatorFrame then return false end
+ if not indicatorFrame or w.screen:id() ~= clickedScreen:id() then return false end
return p:inside(indicatorFrame) -- NOTE: frame *must* be a hs.geometry.rect instance
end)
) |
@kiryph that worked for me! Thanks Edit: Actually, this just moved the issue, with this patch the top menu bar is now unclickable if there is a stack visible on any display. |
@kiryph Try this instead, I guess hammerspoon doesn't count the top menu bar as part of the screen, so when you click up there if not clickedScreen or not indicatorFrame or w.screen:id() ~= clickedScreen:id() then return false end
|
Not sure how to replicate this issue yet, but I suspect it has to do with restarting and reopening windows on login. I am using multiple displays that are arranged like this
+----------------+
| |
| |
+----------------+
+------+
| |
+------+
where lower one is my macbooks display. In case I have a stack on upper display, clicking in the area (on lower display) where stacklike creates clickable app images to change window results in changing the window on that upper display.
The text was updated successfully, but these errors were encountered: