Ken Thomases : winemac: Consolidate the logic for deciding if cursor clipping should be active.
Alexandre Julliard
julliard at winehq.org
Thu Dec 12 12:48:07 CST 2013
Module: wine
Branch: master
Commit: cd10a0df5e1a67feebd06c980139241dfeea9658
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cd10a0df5e1a67feebd06c980139241dfeea9658
Author: Ken Thomases <ken at codeweavers.com>
Date: Wed Dec 11 12:50:23 2013 -0600
winemac: Consolidate the logic for deciding if cursor clipping should be active.
---
dlls/winemac.drv/cocoa_app.m | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index 8ab8954..c9f51d6 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -1316,7 +1316,7 @@ int macdrv_err_on;
- (void) activateCursorClipping
{
- if (clippingCursor)
+ if (cursorClippingEventTap && !CGEventTapIsEnabled(cursorClippingEventTap))
{
CGEventTapEnable(cursorClippingEventTap, TRUE);
[self setCursorPosition:NSPointToCGPoint([self flippedMouseLocation:[NSEvent mouseLocation]])];
@@ -1325,7 +1325,7 @@ int macdrv_err_on;
- (void) deactivateCursorClipping
{
- if (clippingCursor)
+ if (cursorClippingEventTap && CGEventTapIsEnabled(cursorClippingEventTap))
{
CGEventTapEnable(cursorClippingEventTap, FALSE);
[warpRecords removeAllObjects];
@@ -1333,6 +1333,14 @@ int macdrv_err_on;
}
}
+ - (void) updateCursorClippingState
+ {
+ if (clippingCursor && [NSApp isActive])
+ [self activateCursorClipping];
+ else
+ [self deactivateCursorClipping];
+ }
+
- (BOOL) startClippingCursor:(CGRect)rect
{
CGError err;
@@ -1346,8 +1354,7 @@ int macdrv_err_on;
clippingCursor = TRUE;
cursorClipRect = rect;
- if ([NSApp isActive])
- [self activateCursorClipping];
+ [self updateCursorClippingState];
return TRUE;
}
@@ -1358,8 +1365,8 @@ int macdrv_err_on;
if (err != kCGErrorSuccess)
return FALSE;
- [self deactivateCursorClipping];
clippingCursor = FALSE;
+ [self updateCursorClippingState];
return TRUE;
}
@@ -2012,7 +2019,7 @@ int macdrv_err_on;
}
[latentDisplayModes removeAllObjects];
- [self activateCursorClipping];
+ [self updateCursorClippingState];
[self updateFullscreenWindows];
[self adjustWindowLevels:YES];
@@ -2056,6 +2063,8 @@ int macdrv_err_on;
macdrv_event* event;
WineEventQueue* queue;
+ [self updateCursorClippingState];
+
[self invalidateGotFocusEvents];
event = macdrv_create_event(APP_DEACTIVATED, nil);
@@ -2123,8 +2132,6 @@ int macdrv_err_on;
- (void)applicationWillResignActive:(NSNotification *)notification
{
- [self deactivateCursorClipping];
-
[self adjustWindowLevels:NO];
}
More information about the wine-cvs
mailing list