• Ken Thomases's avatar
    winemac: Use CVDisplayLink to limit window redrawing to the display refresh rate. · 3beec95a
    Ken Thomases authored
    Some Windows apps cause user32 to flush the window surface much faster than the
    display refresh rate.  The Mac driver only marks its window as needing to be
    redrawn and lets Cocoa decide how often to actually redraw.  Unfortunately,
    Cocoa redraws each time through the run loop and, since the Mac driver uses a
    run loop source to convey messages from background threads to the main thread,
    it redraws after every batch of messages.
    
    On some versions of OS X, this excessive drawing provokes synchronization with
    the window server's buffer swaps, preventing the main thread from being
    responsive.  Even when that doesn't happen, it's wasteful.
    
    So, we set our windows' autodisplay property to false so that Cocoa never
    displays windows itself.  Then, we arrange to call -displayIfNeeded once per
    display refresh cycle using a CVDisplayLink.  We maintain one CVDisplayLink per
    display (on demand), move windows among them as the windows change screens,
    start them when they acquire their first window, and stop them when they have
    none left.
    Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    3beec95a
Name
Last commit
Last update
..
.gitattributes Loading commit data...
Makefile.in Loading commit data...
clipboard.c Loading commit data...
cocoa_app.h Loading commit data...
cocoa_app.m Loading commit data...
cocoa_clipboard.m Loading commit data...
cocoa_display.m Loading commit data...
cocoa_event.h Loading commit data...
cocoa_event.m Loading commit data...
cocoa_main.m Loading commit data...
cocoa_opengl.h Loading commit data...
cocoa_opengl.m Loading commit data...
cocoa_status_item.m Loading commit data...
cocoa_window.h Loading commit data...
cocoa_window.m Loading commit data...
display.c Loading commit data...
dragdrop.c Loading commit data...
event.c Loading commit data...
gdi.c Loading commit data...
image.c Loading commit data...
ime.c Loading commit data...
keyboard.c Loading commit data...
macdrv.h Loading commit data...
macdrv_cocoa.h Loading commit data...
macdrv_main.c Loading commit data...
mouse.c Loading commit data...
opengl.c Loading commit data...
surface.c Loading commit data...
systray.c Loading commit data...
window.c Loading commit data...
winemac.drv.spec Loading commit data...