winemac: Stop the CVDisplayLink when there are no more changes to flush.
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: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Showing
Please
register
or
sign in
to comment