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
72e89323
Commit
72e89323
authored
May 07, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
May 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Consolidate mouse move handling into -[WineApplicationController handleMouseMove:].
parent
76691853
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
46 deletions
+38
-46
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+1
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+37
-1
cocoa_window.h
dlls/winemac.drv/cocoa_window.h
+0
-4
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+0
-41
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
72e89323
...
...
@@ -60,6 +60,7 @@ enum {
WineWindow
*
lastTargetWindow
;
BOOL
forceNextMouseMoveAbsolute
;
double
mouseMoveDeltaX
,
mouseMoveDeltaY
;
NSMutableArray
*
orderedWineWindows
;
...
...
dlls/winemac.drv/cocoa_app.m
View file @
72e89323
...
...
@@ -1157,6 +1157,7 @@ int macdrv_err_on;
if
([
targetWindow
isKindOfClass
:[
WineWindow
class
]])
{
macdrv_event
*
event
;
BOOL
absolute
=
forceNextMouseMoveAbsolute
||
(
targetWindow
!=
lastTargetWindow
);
forceNextMouseMoveAbsolute
=
FALSE
;
...
...
@@ -1172,7 +1173,42 @@ int macdrv_err_on;
absolute
=
TRUE
;
}
[
targetWindow
postMouseMovedEvent
:
anEvent
absolute
:
absolute
];
if
(
absolute
)
{
CGPoint
point
=
CGEventGetLocation
([
anEvent
CGEvent
]);
event
=
macdrv_create_event
(
MOUSE_MOVED_ABSOLUTE
,
targetWindow
);
event
->
mouse_moved
.
x
=
point
.
x
;
event
->
mouse_moved
.
y
=
point
.
y
;
mouseMoveDeltaX
=
0
;
mouseMoveDeltaY
=
0
;
}
else
{
/* Add event delta to accumulated delta error */
/* deltaY is already flipped */
mouseMoveDeltaX
+=
[
anEvent
deltaX
];
mouseMoveDeltaY
+=
[
anEvent
deltaY
];
event
=
macdrv_create_event
(
MOUSE_MOVED
,
targetWindow
);
event
->
mouse_moved
.
x
=
mouseMoveDeltaX
;
event
->
mouse_moved
.
y
=
mouseMoveDeltaY
;
/* Keep the remainder after integer truncation. */
mouseMoveDeltaX
-=
event
->
mouse_moved
.
x
;
mouseMoveDeltaY
-=
event
->
mouse_moved
.
y
;
}
if
(
event
->
type
==
MOUSE_MOVED_ABSOLUTE
||
event
->
mouse_moved
.
x
||
event
->
mouse_moved
.
y
)
{
event
->
mouse_moved
.
time_ms
=
[
self
ticksForEventTime
:[
anEvent
timestamp
]];
[
targetWindow
.
queue
postEvent
:
event
];
}
macdrv_release_event
(
event
);
lastTargetWindow
=
targetWindow
;
}
else
if
(
lastTargetWindow
)
...
...
dlls/winemac.drv/cocoa_window.h
View file @
72e89323
...
...
@@ -48,8 +48,6 @@
NSUInteger
lastModifierFlags
;
double
mouseMoveDeltaX
,
mouseMoveDeltaY
;
NSInteger
levelWhenActive
;
NSTimer
*
liveResizeDisplayTimer
;
...
...
@@ -68,6 +66,4 @@
-
(
void
)
adjustWindowLevel
;
-
(
void
)
postMouseMovedEvent
:(
NSEvent
*
)
theEvent
absolute
:(
BOOL
)
absolute
;
@end
dlls/winemac.drv/cocoa_window.m
View file @
72e89323
...
...
@@ -952,47 +952,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
event
:
theEvent
];
}
-
(
void
)
postMouseMovedEvent
:
(
NSEvent
*
)
theEvent
absolute
:
(
BOOL
)
absolute
{
macdrv_event
*
event
;
if
(
absolute
)
{
CGPoint
point
=
CGEventGetLocation
([
theEvent
CGEvent
]);
event
=
macdrv_create_event
(
MOUSE_MOVED_ABSOLUTE
,
self
);
event
->
mouse_moved
.
x
=
point
.
x
;
event
->
mouse_moved
.
y
=
point
.
y
;
mouseMoveDeltaX
=
0
;
mouseMoveDeltaY
=
0
;
}
else
{
/* Add event delta to accumulated delta error */
/* deltaY is already flipped */
mouseMoveDeltaX
+=
[
theEvent
deltaX
];
mouseMoveDeltaY
+=
[
theEvent
deltaY
];
event
=
macdrv_create_event
(
MOUSE_MOVED
,
self
);
event
->
mouse_moved
.
x
=
mouseMoveDeltaX
;
event
->
mouse_moved
.
y
=
mouseMoveDeltaY
;
/* Keep the remainder after integer truncation. */
mouseMoveDeltaX
-=
event
->
mouse_moved
.
x
;
mouseMoveDeltaY
-=
event
->
mouse_moved
.
y
;
}
if
(
event
->
type
==
MOUSE_MOVED_ABSOLUTE
||
event
->
mouse_moved
.
x
||
event
->
mouse_moved
.
y
)
{
event
->
mouse_moved
.
time_ms
=
[[
WineApplicationController
sharedController
]
ticksForEventTime
:[
theEvent
timestamp
]];
[
queue
postEvent
:
event
];
}
macdrv_release_event
(
event
);
}
-
(
void
)
setLevelWhenActive
:
(
NSInteger
)
level
{
levelWhenActive
=
level
;
...
...
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