Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5c933c89
Commit
5c933c89
authored
Feb 24, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Feb 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Implement SetCursorPos().
parent
de079223
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
0 deletions
+71
-0
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+2
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+53
-0
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-0
mouse.c
dlls/winemac.drv/mouse.c
+14
-0
winemac.drv.spec
dlls/winemac.drv/winemac.drv.spec
+1
-0
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
5c933c89
...
...
@@ -58,6 +58,8 @@
int
cursorFrame
;
NSTimer
*
cursorTimer
;
BOOL
cursorHidden
;
NSTimeInterval
lastSetCursorPositionTime
;
}
@property
(
nonatomic
)
CGEventSourceKeyboardType
keyboardType
;
...
...
dlls/winemac.drv/cocoa_app.m
View file @
5c933c89
...
...
@@ -548,6 +548,31 @@ int macdrv_err_on;
}
}
-
(
BOOL
)
setCursorPosition
:
(
CGPoint
)
pos
{
BOOL
ret
;
ret
=
(
CGWarpMouseCursorPosition
(
pos
)
==
kCGErrorSuccess
);
if
(
ret
)
{
WineEventQueue
*
queue
;
lastSetCursorPositionTime
=
[[
NSProcessInfo
processInfo
]
systemUptime
];
// Discard all pending mouse move events.
[
eventQueuesLock
lock
];
for
(
queue
in
eventQueues
)
{
[
queue
discardEventsMatchingMask
:
event_mask_for_type
(
MOUSE_MOVED
)
|
event_mask_for_type
(
MOUSE_MOVED_ABSOLUTE
)
forWindow
:
nil
];
}
[
eventQueuesLock
unlock
];
}
return
ret
;
}
/*
* ---------- NSApplication method overrides ----------
...
...
@@ -587,6 +612,17 @@ int macdrv_err_on;
BOOL
absolute
=
forceNextMouseMoveAbsolute
||
(
targetWindow
!=
lastTargetWindow
);
forceNextMouseMoveAbsolute
=
FALSE
;
// If we recently warped the cursor, discard mouse move events until
// we see an event which is later than that time.
if
(
lastSetCursorPositionTime
)
{
if
([
anEvent
timestamp
]
<=
lastSetCursorPositionTime
)
return
;
lastSetCursorPositionTime
=
0
;
absolute
=
TRUE
;
}
[
targetWindow
postMouseMovedEvent
:
anEvent
absolute
:
absolute
];
lastTargetWindow
=
targetWindow
;
}
...
...
@@ -893,3 +929,20 @@ int macdrv_get_cursor_position(CGPoint *pos)
return
TRUE
;
}
/***********************************************************************
* macdrv_set_cursor_position
*
* Sets the cursor position without generating events. Returns zero on
* failure, non-zero on success.
*/
int
macdrv_set_cursor_position
(
CGPoint
pos
)
{
__block
int
ret
;
OnMainThread
(
^
{
ret
=
[
NSApp
setCursorPosition
:
pos
];
});
return
ret
;
}
dlls/winemac.drv/macdrv_cocoa.h
View file @
5c933c89
...
...
@@ -121,6 +121,7 @@ extern void macdrv_beep(void) DECLSPEC_HIDDEN;
/* cursor */
extern
void
macdrv_set_cursor
(
CFStringRef
name
,
CFArrayRef
frames
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_get_cursor_position
(
CGPoint
*
pos
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_set_cursor_position
(
CGPoint
pos
)
DECLSPEC_HIDDEN
;
/* display */
...
...
dlls/winemac.drv/mouse.c
View file @
5c933c89
...
...
@@ -848,6 +848,20 @@ done:
/***********************************************************************
* SetCursorPos (MACDRV.@)
*/
BOOL
CDECL
macdrv_SetCursorPos
(
INT
x
,
INT
y
)
{
BOOL
ret
=
macdrv_set_cursor_position
(
CGPointMake
(
x
,
y
));
if
(
ret
)
TRACE
(
"warped to %d,%d
\n
"
,
x
,
y
);
else
ERR
(
"failed to warp to %d,%d
\n
"
,
x
,
y
);
return
ret
;
}
/***********************************************************************
* macdrv_mouse_button
*
* Handler for MOUSE_BUTTON events.
...
...
dlls/winemac.drv/winemac.drv.spec
View file @
5c933c89
...
...
@@ -22,6 +22,7 @@
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) macdrv_MsgWaitForMultipleObjectsEx
@ cdecl ScrollDC(long long long ptr ptr long ptr) macdrv_ScrollDC
@ cdecl SetCursor(long) macdrv_SetCursor
@ cdecl SetCursorPos(long long) macdrv_SetCursorPos
@ cdecl SetFocus(long) macdrv_SetFocus
@ cdecl SetLayeredWindowAttributes(long long long long) macdrv_SetLayeredWindowAttributes
@ cdecl SetParent(long long long) macdrv_SetParent
...
...
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