-
-
Save raxigan/588bb3c97ec2a2a3b3042846fbf7fe51 to your computer and use it in GitHub Desktop.
disableTopScreenEdgeForDragging = hs.eventtap.new({ hs.eventtap.event.types.leftMouseDragged }, function(e) | |
local loc = e:location() | |
if loc.y == 0.0 then | |
hs.mouse.setAbsolutePosition({ x = loc.x, y = 0.01 }, | |
1337 -- a hack, do not remove | |
) | |
end | |
end) | |
disableTopScreenEdgeForDragging:start() |
This script now interferes with macOS Sequoia's window tiling system, meaning it prevents windows from filling the screen when dragging to the top edge.
I have made a workaround for this by adding a new event listener on left mouse up:
function fill()
hs.application.frontmostApplication():selectMenuItem({"Window", "Fill"})
end
function fillOnTopScreenDragging(e)
if e:location().y == 0.0 then
fill()
end
end
hookLeftMouseUp = hs.eventtap.new({hs.eventtap.event.types.leftMouseUp}, fillOnTopScreenDragging)
hookLeftMouseUp:start()
Thanks for your update @yrnehli. Do you know if the original issue with window dragging and mission control activation is still there? I stopped using hammerspoon completely a while ago and the problem seems to be gone (at least for me). Not sure if it got fixed in some os update or I changed sth in my settings in the meanwhile. My last investigation of this issue was more than 2 years ago.
@raxigan Yeah, the original issue is still present - you have to drag quite quickly and violently to the top of the screen but it still triggers mission control. It annoyingly interferes with the new native macOS tiling system...
The only other tool I've seen where you can disable this is BetterSnapTool.
Thanks for the additional info. Looks like I'll have to replace the keyboard.