Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2e25ba48
Commit
2e25ba48
authored
Jan 19, 2022
by
Tim Clem
Committed by
Alexandre Julliard
Jan 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Create a protocol to represent a cursor clipping handler.
Signed-off-by:
Tim Clem
<
tclem@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1c80eb5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
+26
-12
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+2
-2
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+4
-1
cocoa_cursorclipping.h
dlls/winemac.drv/cocoa_cursorclipping.h
+20
-9
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
2e25ba48
...
...
@@ -67,8 +67,8 @@ enum {
@class
WineEventQueue
;
@class
WineEventTapClipCursorHandler
;
@class
WineWindow
;
@protocol
WineClipCursorHandler
;
@interface
WineApplicationController
:
NSObject
<
NSApplicationDelegate
>
...
...
@@ -121,7 +121,7 @@ enum {
NSTimeInterval
lastSetCursorPositionTime
;
WineEventTapClipCursorHandler
*
clipCursorHandler
;
id
<
WineClipCursorHandler
>
clipCursorHandler
;
NSImage
*
applicationIcon
;
...
...
dlls/winemac.drv/cocoa_app.m
View file @
2e25ba48
...
...
@@ -1148,10 +1148,13 @@ static NSString* WineLocalizedString(unsigned int stringID)
if
([
windowsBeingDragged
count
])
ret
=
FALSE
;
else
if
(
self
.
clippingCursor
)
else
if
(
self
.
clippingCursor
&&
[
clipCursorHandler
respondsToSelector
:
@selector
(
setCursorPosition
:)]
)
ret
=
[
clipCursorHandler
setCursorPosition
:
pos
];
else
{
if
(
self
.
clippingCursor
)
[
clipCursorHandler
clipCursorLocation
:
&
pos
];
// Annoyingly, CGWarpMouseCursorPosition() effectively disassociates
// the mouse from the cursor position for 0.25 seconds. This means
// that mouse movement during that interval doesn't move the cursor
...
...
dlls/winemac.drv/cocoa_cursorclipping.h
View file @
2e25ba48
...
...
@@ -21,15 +21,8 @@
#import <AppKit/AppKit.h>
@interface
WineEventTapClipCursorHandler
:
NSObject
{
BOOL
clippingCursor
;
CGRect
cursorClipRect
;
CFMachPortRef
cursorClippingEventTap
;
NSMutableArray
*
warpRecords
;
CGPoint
synthesizedLocation
;
NSTimeInterval
lastEventTapEventTime
;
}
@protocol
WineClipCursorHandler
<
NSObject
>
@property
(
readonly
,
nonatomic
)
BOOL
clippingCursor
;
@property
(
readonly
,
nonatomic
)
CGRect
cursorClipRect
;
...
...
@@ -41,6 +34,24 @@
-
(
void
)
setRetinaMode
:(
int
)
mode
;
@optional
/* If provided, should reposition the cursor as needed given the current
* clipping rect. If not provided, the location will be clipped by
* -clipCursorLocation, and the cursor will be warped normally.
*/
-
(
BOOL
)
setCursorPosition
:
(
CGPoint
)
pos
;
@end
@interface
WineEventTapClipCursorHandler
:
NSObject
<
WineClipCursorHandler
>
{
BOOL
clippingCursor
;
CGRect
cursorClipRect
;
CFMachPortRef
cursorClippingEventTap
;
NSMutableArray
*
warpRecords
;
CGPoint
synthesizedLocation
;
NSTimeInterval
lastEventTapEventTime
;
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment