Bug 433187 - Moving windows with wobbly windows applied makes the window clip back and fourth slightly
Summary: Moving windows with wobbly windows applied makes the window clip back and fou...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.21.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-18 17:44 UTC by Søren Ølholm
Modified: 2021-02-19 16:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.21.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Søren Ølholm 2021-02-18 17:44:01 UTC
SUMMARY

If I enable wobbly windows and drag a window around, the window pops in and out of the new position once, and makes moving windows feel laggy and janky. 

Here is a video:
https://www.youtube.com/watch?v=zZWjylqxSbo

STEPS TO REPRODUCE
1. Enable compositing
2. turn on wobbly windows
3. move a vindow

OBSERVED RESULT
The window movement is laggy, and the window clips back and fourth into position

EXPECTED RESULT
Normal movement

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.21.0, Kernel 5.10.16-arch1-1, EndeavourOS
(available in About System)
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Vlad Zahorodnii 2021-02-19 16:34:38 UTC
Git commit 33e3b92946a7e645e6a6b221f32b0f2c565d8fd1 by Vlad Zahorodnii.
Committed on 19/02/2021 at 16:34.
Pushed by vladz into branch 'master'.

effects/wobblywindows: Allow model geometry and real geometry get out of sync

Currently, the wobbly windows effect assumes that the window data will
be updated on every repaint. However, there are legit cases when the
time diff between frames can be 0, for example when per screen rendering
is on.

If we are unlucky enough and the geometry of the window changes in that
very short moment, the mapping between window quads and the bezier
patch will be wrong. The window will most likely bounce back and forth.

In order to improve handling of that tricky case, this change makes the
computeBezierPoint() function take the "uv" coordinates rather than the
absolute "xy" coordinates of window vertices. This loosens the
connection between the real geometry of the window and the cached bezier
patch, and overall makes the effect's timing code more robust.

This can be also useful if the wobbly windows effect starts accumulating
time diffs and performing the integration step every N msecs with the
purpose of maintaining uniform "wobbliness" across different refresh rates.

M  +6    -8    src/effects/wobblywindows/wobblywindows.cpp

https://invent.kde.org/plasma/kwin/commit/33e3b92946a7e645e6a6b221f32b0f2c565d8fd1
Comment 2 Vlad Zahorodnii 2021-02-19 16:42:50 UTC
Git commit 705e4fcc688852fec50c08559b6b58e2df2c0973 by Vlad Zahorodnii.
Committed on 19/02/2021 at 16:42.
Pushed by vladz into branch 'Plasma/5.21'.

effects/wobblywindows: Allow model geometry and real geometry get out of sync

Currently, the wobbly windows effect assumes that the window data will
be updated on every repaint. However, there are legit cases when the
time diff between frames can be 0, for example when per screen rendering
is on.

If we are unlucky enough and the geometry of the window changes in that
very short moment, the mapping between window quads and the bezier
patch will be wrong. The window will most likely bounce back and forth.

In order to improve handling of that tricky case, this change makes the
computeBezierPoint() function take the "uv" coordinates rather than the
absolute "xy" coordinates of window vertices. This loosens the
connection between the real geometry of the window and the cached bezier
patch, and overall makes the effect's timing code more robust.

This can be also useful if the wobbly windows effect starts accumulating
time diffs and performing the integration step every N msecs with the
purpose of maintaining uniform "wobbliness" across different refresh rates.
(cherry picked from commit 33e3b92946a7e645e6a6b221f32b0f2c565d8fd1)

M  +6    -8    effects/wobblywindows/wobblywindows.cpp

https://invent.kde.org/plasma/kwin/commit/705e4fcc688852fec50c08559b6b58e2df2c0973