Flaky tooltip visibility when mousing between two tooltip windows

Issue #1064 new
Sean Lindskog created an issue

Repro:

  • run a CEGUI layout with 2 windows (buttons, StaticText, whatever)
  • both windows have a tooltip enabled
  • put the mouse over window 1
  • tooltip appears, as expected
  • quickly move the mouse over window 2
  • tooltip blinks visible for a brief moment, then disappears (bug)

I believe this problem is caused by the FadeOut animation defined on the tooltip in TaharezLook.looknfeel (or OgreTray.looknfeel). If you move the mouse to a new window before the animation has completed, the tooltip appears, but then the animation sets the tooltip to hidden, causing it to erroneously blink out.

For reference, here is the FadeOut animation for the tooltip in TaharezLook.looknfeel: Note the "Visible" affector.

        <AnimationDefinition name="FadeOut" duration="0.33" replayMode="once">
            <Affector property="Alpha" interpolator="float">
                <KeyFrame position="0" sourceProperty="Alpha" />
                <KeyFrame position="0.33" value="0" progression="linear" />
            </Affector>
            <Affector property="Visible" interpolator="bool">
                <KeyFrame position="0" sourceProperty="Visible" />
                <KeyFrame position="0.33" value="false" progression="discrete" />
            </Affector>

            <Subscription event="TooltipInactive" action="Start" />
        </AnimationDefinition>

I assigned this as "major" only because my UI (and I imagine some other people's) rely on tooltips to give extra information about an item icon, a skill icon, or whatever. If the tooltips don't behave, the UI is unacceptably broken.

Comments (2)

  1. Lukas Meindl

    Thanks for the report Sean.

    Did you try anything to resolve this or do you have an idea how to fix this?

  2. Sean Lindskog reporter

    I don't know for sure, because I'm not very familiar with CEGUI's animation stuff. But here's a few thoughts:

    One idea would be to kill the FadeOut animation when a tooltip is activated over a new window. This would prevent the animation from triggering the visibility to false at the improper time (the source of this bug). I see there is a AnimationManager::destroyAnimationInstance function. I think this could be called in function Tooltip::switchToActiveState. The only question then is how to retrieve the AnimationInstance* associated with the FadeOut animation.

    If that proves problematic, another approach would be to change the AnimationDefinition xml data to remove the "Visible" interpolator that sets "Visible" to false. e.g. remove:

                <Affector property="Visible" interpolator="bool">
                    <KeyFrame position="0" sourceProperty="Visible" />
                    <KeyFrame position="0.33" value="false" progression="discrete" />
                </Affector>
    

    However, leave the rest of the FadeOut animation that interpolates the Alpha from 1 -> 0.

    So, now the Animation is no longer responsible for hiding the tooltip. Instead, we'd have to move this functionality to code. We'd need to add code to Tooltip::doInactiveState that checks the tooltip alpha (which is being interpolated to 0 by the animation), and set the tooltip to hidden when the alpha reaches 0. This should also fix the problem, because then if the tooltip is reactivated by hovering over a new window, Tooltip::doInactiveState will no longer be called (instead doActiveState will be), and the tooltip will no longer be improperly hidden.

  3. Log in to comment