RamonUnch/AltSnap

Respect drag threshold to restore a window

RamonUnch opened this issue · 16 comments

AltSnap does not have any drag threshold when we start to move a a Maximized/Snapped window.
Here is a version that fixes the problem:

It adds the DragThreshold value in the [Advanced] section of the ini file:

DragThreshold=1
; Require a small drag before actually starting a movement.
; Set to 0 to disable (like for AtSnap 1.58 and below)
; Set to 1 to have a drag threshold for maximized/snapped windows only (default).
; Set to 2 to always have a drag threshold.

AltSnap1.59test9_x64.zip
AltSnap1.59test9_i386.zip

Could you add an ini entry to customize the threshold amount?
The current default seems more like a placebo.

I use the default system settings for drag threshold, If it is a placebo for you You could also consider increasing the system setting which is used for all drag and drop operations.
https://winaero.com/change-drag-drop-sensitivity-windows-10/

I could add the option but it would be strange because it is already a system option.

PS: I realized that there is a separated setting for dragging a window out a Maximized/snapped state that was added in Windows 7, and I use the generic system drag threshold, I will fix that.
The generic drag threshold if 4 pixels by default and the SPI_GETMOUSEDRAGOUTTHRESHOLD is 20 by default.

This one should use the SPI_GETMOUSEDRAGOUTTHRESHOLD system value.
AltSnap1.59test10_x64.zip

I prefer whenever possible to use system settings.

For testing purposes, I changed the system threshold to 20 pixels.
Now Test9 shows the desired lag clearly.

One benefit should be that drag-free actions can be performed less precisely, but test9, despite no dragging occurring, still demands no cursor movement to apply drag-free actions.
The same with resizing.

One benefit should be that drag-free actions can be performed less precisely, but test9, despite no dragging occurring, still demands no cursor movement to apply drag-free actions.
The same with resizing.

Edit forgot attachment
AltSnap1.59test11_x64.zip

For resizing there is no drag threshold.

This on should work as you expect, as there is a drag threshold tolerance for drag-free action (can only apply to move and if DragThreshold=2)

AltSnap1.59test12_x64.zip
With this build you can set DragThreshold=3 and you will have a threshold even for resizing.

This on should work as you expect, as there is a drag threshold tolerance for drag-free action (can only apply to move and if DragThreshold=2)

Yes, works perferct.

For resizing there is no drag threshold.

Could you manually implement it?
Knowing that Windows uses 4 pixels for dragging and 20 pixels for dragouts, it wouldn't be far off to native system values.

DragThreshold=3
; Require a small drag before actually starting a movement.
; Set to 0 to disable (like for AtSnap 1.58 and below)
; Set to 1 to have a drag threshold for maximized/snapped windows only (default).
; Set to 2 to always have a drag threshold.
; Set to 3 to have a drag threshold for resizing windows (otherwise behaves like DragThreshold=2)

Edit:.
Too late 😎

AltSnap1.59test12_x64.zip
With this build you can set DragThreshold=3 and you will have a threshold even for resizing.

Perfect, makes drag-free actions in general far more reliable.

AltSnap1.59test13_x64.zip

This build no longer breaks Resize+Move combo when enabling drag threshold.
This would happen only if you did not override the Move+RMB (RMBM) combo action.

I think I will set as default:

ScrollM=NPStacked2
ScrollR=Zoom

For the rest, I will leave it alone by default (if LMBR=Nothing and RMBM=Nothing are because Move+Resize and Resize+Move already are useful an retain their specific code, unless overriden.
Also Move+MMB by default will toggle snapping mode when moving, unless overridden with MMBM.
I guess I could set something smart for Resize+MMB, such as Minimize.

Resize+Move does something?

I would keep the theme of the original action in mind.
So Move+MMB toggles zone snapping.
Resize+MMB either extends to zones or to the side/corner.

I Updated the GUI to include the While moving and While resizing radio buttons next to Primary/Secondary/titlebar.

AltSnap1.59test14_i386.zip
AltSnap1.59test14_x64.zip

PS: Do not use the above it is still buggy...

Resize+Move does something?

Resize+Move snaps to side/corner, like double Resize.