Module: wine Branch: stable Commit: 120c8b2cf202ff7a645a62dbde8926c6ee9e67e1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=120c8b2cf202ff7a645a62dbde...
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.
(cherry picked from commit de3fb34af7dbb4a8f73ac4489a02ec2225979d00)
---
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(+)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index bfbb36d..48d3e86 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -1709,6 +1709,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 d7da551..3f6c8f4 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -262,6 +262,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 52875cd..3d436ac 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1687,7 +1687,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); + } }