[PATCH 3/5] winemac.drv: Stop cursor clipping when a window is resized by dragging.

Tim Clem tclem at codeweavers.com
Thu Oct 14 13:39:15 CDT 2021


Testing on Windows confirms this behavior.

Signed-off-by: Tim Clem <tclem at codeweavers.com>
---
For undecorated windows, this already happens via
WINPOS_SysCommandSizeMove, which explicitly calls ClipCursor(NULL). For
decorated windows, that WM_SYSCOMMAND isn't issued for live resizes, so
this callback to the application contoller is necessary.

Note that ef46771 locked windows when the cursor is clipped by default.
The Mac driver registry key CursorClippingLocksWindows must be set to N
to enable this behavior.


 dlls/winemac.drv/cocoa_app.h    | 1 +
 dlls/winemac.drv/cocoa_app.m    | 5 +++++
 dlls/winemac.drv/cocoa_window.m | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/dlls/winemac.drv/cocoa_app.h b/dlls/winemac.drv/cocoa_app.h
index 0b70a2fd55b5..5db083d8e7bd 100644
--- a/dlls/winemac.drv/cocoa_app.h
+++ b/dlls/winemac.drv/cocoa_app.h
@@ -157,6 +157,7 @@ - (BOOL) waitUntilQueryDone:(int*)done timeout:(NSDate*)timeout processEvents:(B
     - (void) noteKey:(uint16_t)keyCode pressed:(BOOL)pressed;
 
     - (void) window:(WineWindow*)window isBeingDragged:(BOOL)dragged;
+    - (void) windowWillStartLiveResize:(WineWindow*)window;
     - (void) windowWillOrderOut:(WineWindow*)window;
 
     - (void) flipRect:(NSRect*)rect;
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index 1e3fd5a9d339..bace8b3973b1 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -1541,6 +1541,11 @@ - (void) window:(WineWindow*)window isBeingDragged:(BOOL)dragged
             [windowsBeingDragged removeObject:window];
     }
 
+    - (void) windowWillStartLiveResize:(WineWindow*)window
+    {
+        [self stopClippingCursor];
+    }
+
     - (void) windowWillOrderOut:(WineWindow*)window
     {
         if ([windowsBeingDragged containsObject:window])
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 80cb26934096..2e63e9645189 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -3060,6 +3060,8 @@ - (void) windowWillStartLiveResize:(NSNotification *)notification
     {
         [self endWindowDragging];
 
+        [[WineApplicationController sharedController] windowWillStartLiveResize:self];
+
         if (maximized)
         {
             macdrv_event* event;
-- 
2.33.0




More information about the wine-devel mailing list