Repository navigation
Make touch snapping work with grid - #3181
Conversation
Fixes snap done with touch not working correctly due to unavailability of touch position after touchup.
c631910 to
5886dd1
Compare
LGTM.
The idea of this is that the slot preview should hide the way it was shown - expanding from the edge of the screen / wherever the pointer is. I definitely think we should keep that. I am a bit confused by the screenshots you have sent .. which of the squares are the previews? I imagine that the issue could be that you move the mouse quickly after release and so the animation looks a bit arbitrary ending in the middle of the screen. Would it be any better if we forced it to be at the edge of the screen? |
Yes, this works well and looks good with one exception:
So I changed the preview animation when window is snaped and droped:
(The commit message is bit misleading - I will change it.)
This could work too, but I like keeping the preview size more.
1st image - preview is in the middle |
…led after Fixes the preview being animated to the mouse pointer position even if the snap was done by touchscreen.
5886dd1 to
7da3ffd
Compare
Oh I see, yes, maybe the move plugin should simply feed the last input position correctly instead of relying on a heuristic? IIRC on drag done we get the correct release position, so if we feed that to grid, both issues here will be resolved? |
|
Yes, that would fix that too, except: The preview would still shrink when the window is to be tiled, which doesnt make much sense to me. Any plugin that will use grid to handle snap will need to cache the previous position - making grid guarantee to do what it shows seems to be cleaner to me. |
Oh I see. Makes sense!
With the previous point, I finally understand the point of this PR 😅 So looking again it LGTM - if you have no further updates to make I'll proceed with merging. |
Fixes #3179.
Grid uses input point to determine tile slot, which is wrong once touch is released because it fallbacks to mouse pointer point.
This changes it to use the currently previewed slot as the final.
Additionaly I changed the preview destroy animation to not resize since it led to showing random squares near the mouse pointer (both images after drag release; please ignore the smaller squares, it's background effect):