• Ken Thomases's avatar
    winemac: Queue an event to reassert the WinAPI window position before Cocoa… · 9372af77
    Ken Thomases authored
    winemac: Queue an event to reassert the WinAPI window position before Cocoa adjusts its position for a display change.
    
    When the display mode changes such that the screen height changes, we'd like
    our windows to keep their position relative to the top-left of the primary
    screen.  That's how WinAPI's coordinate system works and we want the WinAPI
    position of the window to not change just because the display mode changed.
    
    Unfortunately that's not achievable in Cocoa.  Cocoa keeps the window
    stationary relative to the screen it's on, not necessarily the primary screen,
    and it's sometimes relative to the bottom-left and sometimes the top-left of
    that screen.
    
    So, what we do instead is queue an event to get the back end to reassert the
    WinAPI position of the window.  This is queued before Cocoa can adjust the
    Cocoa position of the window which would queue a WINDOW_FRAME_CHANGED to the
    back end and mess up the WinAPI position.  The back end's reassertion of the
    WinAPI position won't be processed by the Cocoa thread until after Cocoa has
    adjusted the position and will thus override it.  It will also discard any
    wrong WINDOW_FRAME_CHANGED that may have been queued.
    Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com>
    9372af77
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...