Giter Club home page Giter Club logo

Comments (26)

RamonUnch avatar RamonUnch commented on August 20, 2024 1

I agree this would be a nice feature, however the Auto-remaximize should not depend on it.
I think I have found the issue, could you try with this version of hooks.dll?
hooks.zip
This one does not add any feature, it just tries to fix the auto-remaximize bug!

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024 1

I really need to get a 1kHz mouse because I do not have any flickering when moving in the snapping area unless I really go crazy and shake the mouse in all directions.
Unfortunately I cannot implement a fix for which I would see no effects, so I will see later.

Logically If you have flickering problems when trying to snap a window then you should increase the AeroMaxSpeed value
and if you have problems when moving fast between monitors, then you should decrease it. This is the theory of course and I understand the reality is more complex.

In reality the speed varies quite a lot along a movement which mean that there may be no threshold speed that can discriminate the desire to go to the other monitor with the desire to snap a window depending on your configuration and on your work flow.

When I get a way to reproduce the flickering you have, I will see if I can implement a re-snap delay.

Keep in mind that if you want to restore old behavior you can just set a very high value for AeroMaxSpeed.

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024 1

This is an improvement. For me, these are good values:

AeroThreshold=32
AeroMaxSpeed=100
AeroSpeedTau=64

I think the behavior is mostly fine now.

The only other small issue I've now noticed is that if the cursor is in the top right of a monitor on the left, and you keep pushing the cursor into the corner, the window will keep jumping (very fast) between the left monitor's corner snap and the right monitor's top left corner snap. I think it has to do with Windows 10's "fake corner" which helps stop/catch the mouse from travelling to the other screen in a dual monitor setup. This also happens for the bottom right corner. Basically any corner between two monitors I assume.

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

I think this feature may actually solve a bug I think I've just encountered: AutoRemaximize=1 sometimes fails when dragging to another screen. I think this may be because if it's done fast, it first attempts to aero-snap because the screen border is being crossed, and then tries to re-maximize, but gets confused because the aero-snap is trying to recover (i.e. to not aero-snap), and so for whatever exact reason, the re-maximize fails and the window remains in its restored state.

v1.35

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

This one does not add any feature, it just tries to fix the auto-remaximize bug!

This seems fixed 🙂

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Ok, here is the AeroMaxSpeed setting in [Advanced] section.
Try a value in the 5-20 range went fine for me, using a 100Hz ish cheap logitech mouse.
Beyond this speed the AeroMoveSnap will be disabled.
I do not have multiples monitor for now so I cannot really test.
If you want the old behavior set it to the max ie: 65535.

AeroMaxSpeed=10
; Speed beyond which AeroSnaps will not occure while Moving.
; Speed is the number of pixels the mouse moved between two frames.
; Maximum 65535 minimum 0; usually around 5-20.
hooks.zip

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

PS: Reading again from the first post, you think it should apply to the window-window snapping too?
Should it apply to snapping when resizing as well?
This would not be difficult anyway.

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

Window-window snapping? I can't snap one window to another window. Actually, it seems Firefox and others can snap to the edge of AltDrag window, but it's not possible to snap to any other window, e.g. Firefox to File Explorer, or File Explorer to File Explorer. Windows can snap to the screen edges however.

; Speed is the number of pixels the mouse moved between two frames.

This will probably be a problem for people with high refresh rate screens I imagine. Even setting AeroMaxSpeed=1 on a 60Hz screen is still causing the occasional aero snap that I do not want (I can work with this value, but I would not want to set it higher than 1). But maybe this is because I have AeroThreshold=64. How would you make it less sensitive, I don't know. Maybe time-based, not frame-based? This is still an improvement upon how it was before though.

Reading again from the first post, you think it should apply to the window-window snapping too?
Should it apply to snapping when resizing as well?

I think it could be nicer if it applied to these also. Less jumpy window movement.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

This does not depend on the screen refresh rate but on the mouse's one.

I can integrate it for several mouse frames, this would give better granularity, but integration reduces reactivity.
Your mouse must be at very high frequency and gives very small values.

Try this one that takes in account for all kind of snapping and integrate the speed over 4 mouse frames.
hooks.zip

This means that to simulate 1 you need 4 now, so try with 3 and 2

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

Try making AeroThreshold=128 for example, then on the right of the screen, move up and down within the 128px threshold. Notice that the window does a lot of flashing (attempting to snap), and on my system, it looks like it's trying to aero-snap into the to top-/bottom-right corner.

If the mouse is within the threshold and moving, it should realize this and stop attempting to aero-snap, unless it moves from the side area to the top or bottom corner.

Try this one that takes in account for all kind of snapping and integrate the speed over 4 mouse frames.
hooks.zip

This means that to simulate 1 you need 4 now, so try with 3 and 2

Anything below 4 doesn't work for me, even if I move 1 or 2px at a time.

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

Your mouse must be at very high frequency and gives very small values.

Mine is 1000Hz / 1ms.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Try making AeroThreshold=128 for example, then on the right of the screen, move up and down within the 128px threshold. Notice that the window does a lot of flashing (attempting to snap), and on my system, it looks like it's trying to aero-snap into the to top-/bottom-right corner.

This is because when you are moving up and down you are doing it at a speed very close to your AeroMaxSpeed so whenever altdrag see that you go faster it restores the window, otherwise it will stay snapped as intended.
Try to increase the AeroMaxSpeed value then, because it seems that while moving your mouse casually you reach speeds higher than 5.

If the mouse is within the threshold and moving, it should realize this and stop attempting to aero-snap, unless it moves from the side area to the top or bottom corner.

I would need a quite long chain of memory of previours cursor positions to do this without breaking snapping.

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

A value of AeroMaxSpeed=20 mostly solved the issue for me.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

I just looked the default mouse drivers refresh at a rate of 8ms/mouse frame specific drivers will permit higher values ie 4ms, 2ms and 1ms
So in this version you can set the number of frames you want the speed to be integrated on.
AeroSpeedInt=4
Corresponds to the current status you are using. the default is 1 because most mouses are at 125Hz.
In your case you can try higher values, ie: 8 => speed/8ms instead of 4. or even higher, you will have to increase AeroMaxSpeed as well.
This is very simple to code and sill gives a good flexibility to the user for a broad range of mouse frequencies.
hooks.zip

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Better try with this one that calculate the speed slightly differently (should be more accurate).
hooks.zip

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

I'm not sure I've understood entirely, but AeroSpeedInt=8 seems roughly like what I had before.

My main concern now is the dozens of times the window tries to snap and then un-snap whilst moving within the AeroThreshold area. It really could have some improvement here. You say you'd need a "long chain of memory of previous cursor positions", but is that the only way? Why not a time-based limitation? I.e. don't attempt to snap if the last snap was <300ms ago? I think something like this could be hard-coded.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

This feature is present il latest 1.36. will be probably improved later.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

@redactedscribe here is a TIME BASED AeroMaxSpeed...
Again I come with an improvement on this feature, try with those values:

in the [Advanced]
AeroMaxSpeed=100
AeroSpeedTau=16

Thi time AeroSpeedTau is in ms, so in 16 ms i expect the cursor to move more that a 100 pixels when going "quite fast"...
Use this hooks.dll and tell me if you find a good combo of values.
The old AeroSpeedInt is no longer used and can be removed.

Tell me if it works for you and which values are the best for you.
hooks.zip

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

It's hard to find a good value for Tau. I am using either 64/128 as the value to reduce the number of times the window incorrectly snaps between two monitors when just attempting to drag a window from one monitor to another.

One problem seems to be, when the mouse is moving but remains inside the AeroThreshold (mine is set to 32), the window keeps snapping and unsnapping. I think it would be better if: if the window is being dragged and it snaps to the monitor's edge, don't try to unsnap the window until it leaves the aero threshold. This means the user will have to (in my case) drag the window outside of the 32px threshold before unsnapping occurs. This would make it behave more stably. Also, if the cursor is inside the aero threshold and it moves from the edge to the corner, it should snap (and not require the user to drag outside of the 32px and then back to the corner).


I think I made mention of this before but, maybe a simpler idea would be more effective and could replace the current approach to this problem: For example, a cursor must remain inside the AeroThreshold for x milliseconds before snapping occurs. This would mean only 1 value for the user to configure, and it would be easier to understand its effect without needing to test the settings as much. This idea should also work with the paragraph above (about not re-snapping before leaving the threshold).

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Could you give me your ini file, I cannot reproduce this.
Normally the windows should not restore when you move it and your cursor is in the snap region.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Ok, it actually happens if you snap a a window, release the mouse and then click again inside the snap region.
In this case the window will snap/unsnap very fast when moving the cursor.

I can easily reduce the resnaping to one, but if I want to completely disable it it will take more code rework.
hooks.zip

You mean you use Tau=64ms and MaxSpeed=128xpiels? ie max speed = 128px/64ms

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

I didn't notice any change. What I was describing doesn't involve releasing the mouse button:

  1. Click and drag a window to the edge (within AeroThreshold).
  2. Keep holding the mouse button down and move the window up and down inside AeroThreshold area.

It's not so important to me as I can live with how it is working, but I think it would be better if it only snaps once, and never again until leaving the threshold area and entering it again.

I meant Tau 64 or 128. With both, I use AeroMaxSpeed=100.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Give me your altdrag.ini file, maybe I can reproduce your issue.
you can zip it and attach it to a post.

from altsnap.

redactedscribe avatar redactedscribe commented on August 20, 2024

Here you go. AltDrag.zip

You can make things easier by increasing AeroThreshold to, for example, from 32 to 100 to make it easier to test.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

Ok, I think I understand try with this hooks.dll
two things:
First your problem should be fixed.
Second you can now even set the AeroMaxSpeed at 0 and still be able to snap by stopping the cursor in the snapping region and waiting 2*AeroSpeedTau without moving.
hooks.zip

There is a small drawback when changing monitor the window should "jump" but I think this is not a big deal.

from altsnap.

RamonUnch avatar RamonUnch commented on August 20, 2024

In version 1.43, the option will be available through the GUI. I will have a look to the corner issue when I get my hand on a 2 monitor setup.

from altsnap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.