Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snap to layout] - Ugly screen tearing #218

Closed
onguarde opened this issue Jul 21, 2022 · 18 comments · Fixed by #227
Closed

[Snap to layout] - Ugly screen tearing #218

onguarde opened this issue Jul 21, 2022 · 18 comments · Fixed by #227
Labels
bug Something isn't working

Comments

@onguarde
Copy link

onguarde commented Jul 21, 2022

When "Snap to Layout with Shift" option is enabled, moving windows with alt+shift+drag results in a lot of tearing. The window size keeps changing frantically as you move the mouse.

I experimented with the Performance parameters in AltSnap.ini file. When RezTimer is set to 0, it gives the best visual experience. When the window size is totally fixed while moving, and eventually it gets resized only once, when you reach a snap layout position.

I believe this should be the default and documented somewhere in the wiki.

RezTimer=1
;RezTimer=0 ; orig
; Set to 1 to move the window only when the timestamp of
; a mouse event is different from the previous one, every 16ms
; more or less. MoveRate and ResizeRate and RefreshRate
; will have no effect if the option is enabled.
; This is overall the option that gives the best performances.
; It can be combined with FullWin=0 mode for ~0% CPU usage.

@onguarde onguarde changed the title (fancyzones) Snap to Layout with Shift - Default should be RezTimer=1 (fancyzones) Snap to Layout with Shift - Ugly screen tearing Jul 21, 2022
@onguarde
Copy link
Author

I'm using 1000 Hz gaming mouse.

default.-.with.screen.tearing.mp4

@Ichisich
Copy link

Try setting InterZone=0

@RamonUnch
Copy link
Owner

Try setting InterZone=0

I confirm this idea. You are seeing flicker because when you point your mouse between two zones, the window will be resized to cover both. If you set InterZone to zero, then the behaviour will be disabled and the only way to extend a window to several zones will be using Ctrl key.

@RamonUnch
Copy link
Owner

However in general I would recommend setting RezTimer=1 if you use a 60Hz monitor.

@RamonUnch RamonUnch added the bug Something isn't working label Jul 21, 2022
@onguarde
Copy link
Author

I applied InterZone=0, I can't tell the difference.
RezTimer=1 seems to help a lot, but it's still happening when the windows being moved are complex. Eg. webpages.

webpage.tearing.mp4

I really like the Microsoft FancyZones's implementation,

fancyzone.dragging.mp4

The window is NOT resized at all until it's dropped to the other zone. We can achieve something similar simply by enabling FullWin=0 now. But this setting will also affect normal dragging, without "snap to layout".

@Ichisich
Copy link

Could you share your AltSnap.ini?

@RamonUnch
Copy link
Owner

I agree Fancy zones method is quite good. In general I plan to implement a snapping preview in the future for all kind of snapping see Issue #106 for more.

However the latest test build should fix a part of the problem, because when you start moving a Snapped window it will no longer restore it if you are in Zone-snapping mode. This would cause a visible flicker that could be quite long for windows that are slow drawers.

I would like to see your .ini file, because I do not see how the RezTimer should affect Zone snapping.
In any case the window should be resized only once when the cursor changes zone. If it is not the case then something should be fixed.

@onguarde
Copy link
Author

AltSnap.ini.txt

@onguarde
Copy link
Author

The tearing issue is a lot less, it's barely noticeable but it's there. Video recording makes it worse, so it's difficult to show exactly.

with.and.without.Fullwin.mp4

Notice in the video, the monitor is split into 3. Dragging one window from the left all the way to right, is not a very nice visual experience. It snaps to each layout position en-route to it's final destination.

I've tried to play with this setting, but didn't notice any difference.

AutoSnap=0
;AutoSnap=2; orig
; Makes a window automatically snap to other windows, without the need to press shift.
; List of settings:
; 0: Disabled.
; 1: Automatically snaps to the screen borders and the taskbar.
; 2: Also automatically snaps to the outside of windows.
; 3: Also automatically snaps to the inside of windows.

@Ichisich
Copy link

Ichisich commented Jul 22, 2022

However the latest test build should fix a part of the problem, because when you start moving a Snapped window it will no longer restore it if you are in Zone-snapping mode. This would cause a visible flicker that could be quite long for windows that are slow drawers.

@onguarde
I can reproduce a resize flicker as soon as I initiate a zone snap. It's even noticeable without changing the zone.
Try it with this setting enabled:
Screenshot 2022-07-22 120859

@onguarde
Copy link
Author

onguarde commented Jul 22, 2022

i tried but I can't tell any difference. Mine is on disabled. Probably need to agree on a standard test window, to make comparisons easier.

@Ichisich
Copy link

Ichisich commented Jul 22, 2022

From your videos, which would be more useful with a higher frame rate, it looks like your PC struggles with resizing the window fast enough to be unnoticeable.
This is why FullWin=0 bypasses this issue.

You could experiment with different ResizeRate.
The best test window is the Windows Explorer.
Very low reactivity and the white flicker indicates the resize delay very clearly.

@RamonUnch
Copy link
Owner

AutoSnap setting will not change anything, I agree with Ichisich, your problem is just a slow desktop, there is no much I can do outside of FullWin=0.
The initial flicker should no longer be there with the 1.54 test 10 and later...
With test11, you can have a transparent window that may fix your problem.

@RamonUnch
Copy link
Owner

A thing that might help is the Max Aero Speed;
I will implement it for Zone snapping, for now it is not implemented.

@RamonUnch
Copy link
Owner

Here we go:
With the below build the windows will be not moved if the cursor speed is higher than the Max snapping (see Advanced tab).

AltSnap1.54test12_x64.zip

I suggest you start with a Max Snapping Speed of 64pixels/64ms, then try increasing or decreasing depending on your taste.

If the cursor goes faster than the max snapping speed, then the windows will not be moved until the cursor slows down. like this you can move quickly your cursor over a zone without having the window snap to it.

@RamonUnch
Copy link
Owner

Note that the above test build also contains the transparent rectangle option available via the TransWinOpacity=128 in the [Performance] section of the .ini file

@onguarde
Copy link
Author

onguarde commented Jul 24, 2022

awesome, this works perfectly too, i put my value as 16.

image

However, I ended up preferring the new FullWin=0, "transparent rectangle" option.
#223

This one is perfectly usable really, just a matter of preference.

Because this relies on the speed of the cursor, it's a teeny bit harder to control. However, the advantage is you can quickly try multiple snap layouts, without releasing your left mouse drag.

Below are my full settings for reference,

[Advanced]
AeroMaxSpeed=16

AltSnap.zip

@onguarde
Copy link
Author

onguarde commented Jul 24, 2022

image

In the advanced settings option, i don't get what is the number 32 in the second box. I can't edit this from GUI. Looking at the Altsnap.ini, it seems to be linked to AeroSpeedTau=32.

What does that do?

Max Snapping Speed of 64pixels/64ms,

I presume it corresponds to the second value in your quote above? So in my case,

AeroMaxSpeed=16
AeroSpeedTau=32

max speed =16pixels/32ms.
need to move 16 pixels in 32 ms.

Anyway, i believe we don't need to edit that for this to work. Perhaps we can add the units (pixels) and (ms) inside the GUI, to make things clearer.

@onguarde onguarde changed the title (fancyzones) Snap to Layout with Shift - Ugly screen tearing [Snap to layout] - Ugly screen tearing Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants