winemac: Queue an event to reassert the WinAPI window position before Cocoa adjusts...
commit9372af77a546609b703070d60ef773d5ae7c2ddd
authorKen Thomases <ken@codeweavers.com>
Mon, 5 Oct 2015 20:44:28 +0000 (5 15:44 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 6 Oct 2015 08:21:01 +0000 (6 17:21 +0900)
tree7a24ee290bb206c047b6bfe28e46d5167c8aefaf
parent01a5e00479c1360596369892092a1f6a9cd11458
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: Ken Thomases <ken@codeweavers.com>
dlls/winemac.drv/cocoa_window.m
dlls/winemac.drv/event.c
dlls/winemac.drv/macdrv.h
dlls/winemac.drv/macdrv_cocoa.h
dlls/winemac.drv/window.c