kwin/effects
Erik Kurzinger 30ad58f559 [effects/presentwindows] Avoid potential freeze during fill-gaps
Summary:
When using the natural layout algorithm with the fill-gaps option, a small
error (less than one) is introduced in windows' aspect ratio each time they are
enlarged due to floating-point roundoff.

Currently, the algorithm computes the width and height enlargement factors and
then attempts to enlarge in each of the four possible directions, repeating
until it can't enlarge any windows any further.  Hence, this aspect ratio error
can be multiplied by up to four. Especially for small, long, and narrow
windows, this can result in a total error of greater than one by the end of
that loop iteration. If this occurs, on subsequent iterations the height
enlargement factor might then be computed as negative violating some of the
core assumptions of the algorithm and resulting in the loop iterating endlessly
until one of the window dimensions overflows, freezing the program for up to
several minutes.

To fix this, the height enlargement factor should be re-computed based on the
new width each time the window is enlarged, ensuring the error introduced in
the aspect ratio never exceeds one.

BUG: 364709
BUG: 380865
BUG: 368811

FIXED-IN: 5.15.0

Test Plan:
The most reliable way to reproduce the freeze seems to be to activate the
desktop-grid effect while a tool-tip window is fading in.
Ensure desktop-grid is configured to use present windows, and that present
windows is configured to use the natural layout algorithm with the fill gaps
option selected.

The freeze is still intermittent, but using this method should be able to be
triggered within about 10 tries without this fix.
After applying the fix, the freeze has never been observed.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: graesslin, kwin, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16278
2018-10-20 18:37:45 +03:00
..
backgroundcontrast [effects/backgroundcontrast] Use override keyword 2018-10-18 19:16:17 +03:00
blur [effects/blur] Add missing override keywords 2018-09-24 15:42:22 +03:00
colorpicker Scaling support in ColorPicker effect 2017-04-28 10:23:13 +01:00
coverswitch [effects/coverswitch] Use override keyword 2018-10-18 19:15:13 +03:00
cube [effects/cube] Update cubecap texture 2018-09-28 21:20:11 +03:00
cubeslide [effects] Move the Desktop Cube Animation effect to its own directory 2018-09-28 20:07:32 +03:00
desktopgrid SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
dialogparent [effects/dialogparent] Fix flickering of parent windows 2018-10-10 18:34:12 +03:00
diminactive [effects/diminactive] Dim Wayland clients 2018-10-19 14:38:10 +03:00
dimscreen [effects/dimscreen] Make it work on Wayland 2018-10-19 17:49:37 +03:00
eyeonscreen [kcmkwin/compositing] Move show desktop effects to their own category 2018-08-02 16:32:57 +03:00
fade Disable fade effect during fullscreen effects 2018-10-04 13:05:51 +01:00
fadedesktop [effects/fadedesktop] Properly check whether given window is on a particular virtual desktop 2018-10-11 16:22:34 +03:00
fallapart [effects/fallapart] Fade out window parts 2018-06-14 16:38:12 +03:00
flipswitch Fix minor EBN issues 2018-08-29 21:02:16 +03:00
frozenapp SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
glide [effects] Add plasmashell to the blacklist of Glide and Scale effect on Wayland 2018-10-18 19:18:03 +03:00
highlightwindow [effects] Support xcbConnectionChanged for support properties 2017-09-12 18:53:31 +02:00
invert SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
kscreen [effects/kscreen] Port to TimeLine 2018-07-05 23:00:27 +03:00
login SVN_SILENT made messages (.desktop file) - always resolve ours 2018-08-11 05:34:25 +02:00
logout SVN_SILENT made messages (.desktop file) - always resolve ours 2018-10-20 06:05:01 +02:00
lookingglass SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
magiclamp SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
magnifier [effects/magnifier] Fix 1 px gap between magnified area and frame 2018-09-10 13:08:25 +03:00
maximize SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
minimizeanimation [effects/minimizeanimation] Delete useless comments 2018-08-15 12:11:58 +03:00
morphingpopups [effects/morphingpopups] Use enumerators from the DataRole enum 2018-09-24 15:41:13 +03:00
mouseclick SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
mousemark [effects/mousemark] Properly use GL_LINE_SMOOTH 2018-08-09 22:52:37 +03:00
presentwindows [effects/presentwindows] Avoid potential freeze during fill-gaps 2018-10-20 18:37:45 +03:00
resize SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
scale SVN_SILENT made messages (.desktop file) - always resolve ours 2018-10-20 06:05:01 +02:00
screenedge [ScreenEdgeEffect] Create glow Svg on demand 2017-09-28 10:18:36 +02:00
screenshot [effects/screenshot] Use override keyword 2018-10-17 02:39:53 +03:00
sheet [effects/sheet] Modernize code 2018-08-12 11:18:37 +03:00
showfps SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
showpaint SVN_SILENT made messages (.desktop file) - always resolve ours 2018-10-10 06:54:14 +02:00
slide [effects/slide] Simplify logic that forces blur and background contrast 2018-10-02 19:54:37 +03:00
slideback [effects] Ignore previous state of WindowForceBlurRole 2018-06-19 15:23:41 +03:00
slidingpopups [effects/slidingpopups] Fix jumpy transition between In and Out animations 2018-10-08 14:14:14 +03:00
snaphelper
startupfeedback Remove Qt module declarations in includes 2018-06-05 18:07:23 +01:00
thumbnailaside SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
touchpoints Fix unused-parameter warnings as reported by GCC 2017-07-28 21:31:09 +02:00
trackmouse [effects/trackmouse] Allow to use both modifiers and shortcut 2018-09-12 16:37:05 +03:00
translucency [effects/translucency] Make inactive Wayland clients translucent 2018-10-19 18:24:47 +03:00
windowaperture [kcmkwin/compositing] Move show desktop effects to their own category 2018-08-02 16:32:57 +03:00
windowgeometry SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
wobblywindows [effects/wobblywindows] Delete commented code 2018-10-18 19:17:13 +03:00
zoom [effects/zoom] Set wrap mode for cursor texture 2018-10-04 21:40:49 +03:00
CMakeLists.txt [effects/showpaint] Use a shortcut to toggle the effect 2018-09-28 20:12:22 +03:00
effect_builtins.cpp [effects] Move the Desktop Cube Animation effect to its own directory 2018-09-28 20:07:32 +03:00
effect_builtins.h [effects] Add Scale effect 2018-08-12 10:57:41 +03:00
kwineffect.desktop [effects] Fix type of X-KWin-Video-Url 2018-09-11 13:46:35 +03:00
logging.cpp
Messages.sh
shaders.qrc Removed the "fastblur" path 2018-02-03 19:04:11 +01:00