• Ken Thomases's avatar
    winemac: Stop the CVDisplayLink when there are no more changes to flush. · b4fc81bd
    Ken Thomases authored
    The change to a CVDisplayLink-driven display mechanism introduced a problem: a
    Wine process never went completely idle for long periods.  The display link
    would fire for every refresh cycle of the display, waking a CPU from idle and
    wasting energy.
    
    To fix that, I have the display link stop itself when it determines that none
    of its windows need to be displayed.  When a window is subsequently marked as
    needing display, it either temporarily re-enables Cocoa's normal autodisplay
    mechanism so that it displays at the end of the current turn of the run loop,
    or it restarts the display link.  It chooses the former if it's been a long
    time since the window was last displayed so that the display is done more
    immediately.
    Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    b4fc81bd
cocoa_window.h 2.69 KB