Open ianfixes opened 6 years ago
Thinking more about this, I wonder if my suggested fix is wrong. In other words, I think things are indeed working as expected: the part of the peeked window that you drag is indeed being dragged "outside" of its frame -- that's due to the peeking behavior.
|--- screen --|
: :
: drag -+ :
: down | :
: V :
+------+-:-Y--+
|//////|XXX\\\|
|////A/|XXX\B\|
|//////|XXX\\\|
+------+---|--+
(note that where I indicated "drag down",
it is indeed _outside_ of the frame
designated for the focused window).
So I think the proper fix might be more along the lines of "if the dragged mouse cursor leaves the frame where the focused window had been placed -- peeking included -- then swap it".
The one edge case I can think of is when the window becomes focused via a drag event; this could cause an un-peeked window to peek, which would change the location you'd have to drag to in order to complete a swap.
Still thinking about this, but how would another window grab focus during a drag event?
In the example above, if window A was focused (meaning B was shoved partially off-screen), you can then start dragging window B -- it will focus and then peek. This has the effect of changing the part of window B that your cursor is holding, even though your cursor position on screen doesn't change.
The current implementation of that edge case is proper behavior -- you would only have to drag window B until your cursor enters the frame for window A. But in the behavior I just described (drag outside of peeked window B's boundary), it would mean you have to drag much further -- you must pass the boundary of B's peeked position.
I feel like I'm doing a terrible job of explaining this. But the good news is that I think I'm describing a fix for something that maybe nobody else will notice.
Should I record some gifs to make this conversation easier?
Do you think there is an immediate change necessary for this? I'm wondering if we should hold off on it for the next version since there's still some open questions.
Oh, and gifs would be great if that's possible.
here are the 2 quirks
This issue's title describes the first quirk shown in this gif. It comes down to the fact that if your eyes follow the movement of the settings window, it looks like you've dragged it enough. But Amethyst is looking at the movement of the mouse pointer, which is easily overshadowed by the peeking of an entire window.
I'm not sure if anything can resolve this, short of storing the distances of the peek movement in the mouse state and factoring that in to a swap decision. (And that option sounds like a can of worms that might result in really obscure and weird behavior down the road.)
So for now I'm just reporting it.
System
0.12.0b
10.12.6 (16G29)
What's the problem?
Exposed in #685 : with window peeking now (re)enabled, windows that are larger than their frame can be moved to overlap other windows. This makes a pre-existing bug more frequent, namely that dragging a window within its (apparent) frame can cause an unexpected swap. This is because the mouse may actually be in another window's frame due to peeking.
How can it be reproduced?
A
andB
. Let's say each window has a 600px minimum width.: : +----------Y--+----+ |//////////|\|
| |////A/////|\B|
| |//////////|\|````| +----------|--+----+: : +------+---Y--+ |//////|XXX\| |////A/|XXX\B| |//////|XXX\| +------+---|--+
: drag -+ : : down | : : V : +------+-:-Y--+ |//////|XXX\| |////A/|XXX\B| |//////|XXX\| +------+---|--+