Module: wine Branch: master Commit: de3fb34af7dbb4a8f73ac4489a02ec2225979d00 URL: http://source.winehq.org/git/wine.git/?a=commit;h=de3fb34af7dbb4a8f73ac4489a...
Author: Ken Thomases ken@codeweavers.com Date: Thu Oct 31 16:54:53 2013 -0500
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.
---
dlls/winemac.drv/cocoa_window.m | 1 + dlls/winemac.drv/macdrv_cocoa.h | 1 + dlls/winemac.drv/window.c | 6 ++++++ 3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index b81de72..51bcaea 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -1718,6 +1718,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif 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);
diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index f714cc5..7bc021c 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -275,6 +275,7 @@ typedef struct macdrv_event { struct { CGRect frame; int fullscreen; + int in_resize; } window_frame_changed; struct { unsigned long serial; diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 4e132fa..75fd523 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -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); + } }