Skip to content
  • Neil Roberts's avatar
    Set new state before emitting wake signal in weston_compsitor_wake · 8b62e204
    Neil Roberts authored
    The wake handler set up by the shell will try to unlock the screen
    which works by setting up an animation which fades in the display. The
    animation is started by first scheduling a repaint. Subsequent
    repaints are scheduled whenever the previous frame is finished.
    However in the case of the wake up signal the state is still
    WESTON_COMPOSITOR_SLEEPING when the animation is started.
    weston_output_schedule_repaint() ignores attempts to schedule a
    repaint if the compositor is sleeping which means the animation never
    gets run and will never complete.
    
    The animation gets unstuck and continues if anything else schedules a
    repaint after the state has been changed so the bug only gets hit in
    certain conditions. The first wake up creates the lock surface which
    causes a redraw when the first buffer is attached so the first wake up
    is always ok. A redraw can be triggered in the subsequent wake ups
    just by moving the mouse.
    
    A good way to trigger the bug is to try to wake up the compositor by
    pressing the shift key. If you let the compositor go back to sleep
    after waking it up without unlocking it, the second press of the shift
    key will not cause a redraw so the animation will not run and it won't
    fade in.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=69719
    8b62e204