winemac: Send WM_{ENTER, EXIT}SIZEMOVE around window frame changes initiated by Cocoa.

The Mac driver was already sending these events when the user resizes the
window by dragging its corner/edges, but there are other occasions when the
window frame changes.  For example, when the user zooms the window.
This commit is contained in:
Ken Thomases 2013-10-31 16:54:53 -05:00 committed by Alexandre Julliard
parent b11d6850f2
commit de3fb34af7
3 changed files with 8 additions and 0 deletions

View File

@ -1718,6 +1718,7 @@ - (void)windowDidResize:(NSNotification *)notification
event = macdrv_create_event(WINDOW_FRAME_CHANGED, self);
event->window_frame_changed.frame = NSRectToCGRect(frame);
event->window_frame_changed.fullscreen = ([self styleMask] & NSFullScreenWindowMask) != 0;
event->window_frame_changed.in_resize = [self inLiveResize];
[queue postEvent:event];
macdrv_release_event(event);

View File

@ -275,6 +275,7 @@ extern int macdrv_set_display_mode(const struct macdrv_display* display,
struct {
CGRect frame;
int fullscreen;
int in_resize;
} window_frame_changed;
struct {
unsigned long serial;

View File

@ -1718,7 +1718,13 @@ void macdrv_window_frame_changed(HWND hwnd, const macdrv_event *event)
if (event->window_frame_changed.fullscreen)
flags |= SWP_NOSENDCHANGING;
if (!(flags & SWP_NOSIZE) || !(flags & SWP_NOMOVE))
{
if (!event->window_frame_changed.in_resize)
SendMessageW(hwnd, WM_ENTERSIZEMOVE, 0, 0);
SetWindowPos(hwnd, 0, rect.left, rect.top, width, height, flags);
if (!event->window_frame_changed.in_resize)
SendMessageW(hwnd, WM_EXITSIZEMOVE, 0, 0);
}
}