Bug 360068 - Sometimes two animation ids can be *not* unique
Summary: Sometimes two animation ids can be *not* unique
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-04 13:45 UTC by Marco Martin
Modified: 2016-04-14 13:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
prints that show the bug (2.67 KB, patch)
2016-03-04 13:46 UTC, Marco Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Martin 2016-03-04 13:45:18 UTC
since the morphingpopups effect was introduced, every now and then plasma tooltips go flying across the screen right to the top left corner.

debugging the issue, I discovered that's because sometimes different animations can have the same id
Using adresses on the stack as ids, it's possible that if an animation is canceled, then creating immediately after a new one, it will have the same adress, the ids should be globally incremented static longs instead.

Reproducible: Sometimes

Steps to Reproduce:
apply the patch
quickly move the mouse around the taskbar or other plasma tooltips (or possibly other tooltips, like qt applications toolbar tooltips)
every now and then, the tooltip goes flying to 0,0 position

looking at the standard output,  there should be a "MOVE ANIMATION ID:" and "FADE ANIMATION ID:" with the same id
Comment 1 Marco Martin 2016-03-04 13:46:23 UTC
Created attachment 97677 [details]
prints that show the bug

this patch prints out animation ids: it's possible to see the same id popping up multiple times
Comment 2 Marco Martin 2016-03-04 14:12:32 UTC
https://git.reviewboard.kde.org/r/127276/
Comment 3 Marco Martin 2016-03-04 17:19:47 UTC
Git commit 595c5937c9a1e13bdeed2759034ed66d8c89d614 by Marco Martin.
Committed on 04/03/2016 at 17:19.
Pushed by mart into branch 'master'.

use a global static for animation ids

using stack adresses makes it possible (even tough not frequent)
for two animations (onle just killed, one just created) to have
the same id, causing scripts to be potentially really confused.
this replaces the id with a global counter, and the
"flying tooltips" bug is gone.

REVIEW:127276
Related: bug 352254

M  +2    -0    libkwineffects/anidata_p.h
M  +8    -4    libkwineffects/kwinanimationeffect.cpp

http://commits.kde.org/kwin/595c5937c9a1e13bdeed2759034ed66d8c89d614
Comment 4 Martin Flöser 2016-03-23 11:06:15 UTC
Git commit a9fad7396e30a380a27090538e7e66dec6984c52 by Martin Gräßlin, on behalf of Marco Martin.
Committed on 23/03/2016 at 11:03.
Pushed by graesslin into branch 'Plasma/5.6'.

use a global static for animation ids

using stack adresses makes it possible (even tough not frequent)
for two animations (onle just killed, one just created) to have
the same id, causing scripts to be potentially really confused.
this replaces the id with a global counter, and the
"flying tooltips" bug is gone.

REVIEW:127276
Related: bug 352254

M  +2    -0    libkwineffects/anidata_p.h
M  +8    -4    libkwineffects/kwinanimationeffect.cpp

http://commits.kde.org/kwin/a9fad7396e30a380a27090538e7e66dec6984c52