These are chat archives for ianyh/Amethyst

Aug 2017
Aug 01 2017 12:16
New mouse behavior and event detection is implemented and working
However, what is not working reliably is detecting the window under the window I am dragging
I had initially implemented this as a hack -- get the mouse pointer, look for what windows might be under this point, take the second window on the list (the first window being the window that is dragged)
What I'd prefer to do is ask the window manager "hey which frame encompasses the given point", and then just get the reference to the window in that frame
I'm not sure how to do that :/
It's probably obvious but I'm drawing a blank here
Aug 01 2017 14:15
I can put more of a fine point on this problem... here goes
Sometimes the window that I'm dragging doesn't list itself as being below the mouse pointer
Ian Ynda-Hummel
Aug 01 2017 15:30
Can you track which window is being dragged via the accessibility APIs? You could then take the windows under the mouse location, remove the currently dragged one if it's there, then take the first window from the filtered list.
Aug 01 2017 16:10
i'll see what I can do with that
The reason that I ask is because the mouse-related management stuff I'm putting in now should put me in a good spot to do the drag-to-resize behavior
I will need some similar support from the window manager to figure out (1) whether i'm resizing the main frame at any given moment, and (2) whether the width or height is adjustable for this layout type, and (3) how to calculate the new dimension
Ian Ynda-Hummel
Aug 01 2017 17:17
Oh, one thing I noticed in the docs is that NSEvent.mouseLocation is synthesized from current event stream and not from anything pending. Possibly it's lagging behind the actual location which is causing the missing window.
Maybe we should track mouse move events and get the location that way.
Thank you for going through this mouse tracking stuff, by the way. It'll set up more than just the drag to resize. Opens up a lot of non-keyboard interaction.
Aug 01 2017 18:16
I'm not sure what the best course of action is. I'd love to get the mouse notifications and kAXWindowMovedNotification in the same stream, but failing that I'd expect NSEvent.mouseLocation to return the same value as the latest location given in a mouse event stream.
don't be an idiot like me
don't spend time troubleshooting a use case where you drag a window but your pointer never leaves that window's empty frame... and you try to figure out why nothing is swapping places
(I was trying to drag a window very quickly to produce the case where events came in a different order)
Aug 01 2017 18:25
Also, chrome windows are now more reliably doing stupid behavior -- resizing them causes a window move event.
and that move event triggers a swap
so you can resize a chrome window into a different frame
Chrome has OSX fooled, so I'm not sure what I can hope to do about it