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
0a56ef35
Commit
0a56ef35
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: Handle mouse moves in -[WineApplication sendEvent:] instead of WineWindow.
parent
38f7a4d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
18 deletions
+51
-18
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+3
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+43
-1
cocoa_window.h
dlls/winemac.drv/cocoa_window.h
+2
-1
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+3
-16
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
0a56ef35
...
...
@@ -47,6 +47,9 @@
CGFloat
primaryScreenHeight
;
BOOL
primaryScreenHeightValid
;
WineWindow
*
lastTargetWindow
;
BOOL
forceNextMouseMoveAbsolute
;
NSMutableArray
*
orderedWineWindows
;
NSMutableDictionary
*
originalDisplayModes
;
...
...
dlls/winemac.drv/cocoa_app.m
View file @
0a56ef35
...
...
@@ -554,10 +554,40 @@ int macdrv_err_on;
*/
-
(
void
)
sendEvent
:
(
NSEvent
*
)
anEvent
{
if
([
anEvent
type
]
==
NSFlagsChanged
)
NSEventType
type
=
[
anEvent
type
];
if
(
type
==
NSFlagsChanged
)
self
.
lastFlagsChanged
=
anEvent
;
[
super
sendEvent
:
anEvent
];
if
(
type
==
NSMouseMoved
||
type
==
NSLeftMouseDragged
||
type
==
NSRightMouseDragged
||
type
==
NSOtherMouseDragged
)
{
WineWindow
*
targetWindow
;
targetWindow
=
(
WineWindow
*
)[
anEvent
window
];
if
([
targetWindow
isKindOfClass
:[
WineWindow
class
]])
{
BOOL
absolute
=
forceNextMouseMoveAbsolute
||
(
targetWindow
!=
lastTargetWindow
);
forceNextMouseMoveAbsolute
=
FALSE
;
[
targetWindow
postMouseMovedEvent
:
anEvent
absolute
:
absolute
];
lastTargetWindow
=
targetWindow
;
}
else
lastTargetWindow
=
nil
;
}
else
if
(
type
==
NSLeftMouseDown
||
type
==
NSLeftMouseUp
||
type
==
NSRightMouseDown
||
type
==
NSRightMouseUp
||
type
==
NSOtherMouseDown
||
type
==
NSOtherMouseUp
||
type
==
NSScrollWheel
)
{
// Since mouse button and scroll wheel events deliver absolute cursor
// position, the accumulating delta from move events is invalidated.
// Make sure next mouse move event starts over from an absolute baseline.
forceNextMouseMoveAbsolute
=
TRUE
;
}
}
...
...
@@ -583,12 +613,22 @@ int macdrv_err_on;
// activated. This will provoke a re-synchronization of Wine's notion of
// the desktop rect with the actual state.
[
self
sendDisplaysChanged
:
TRUE
];
// The cursor probably moved while we were inactive. Accumulated mouse
// movement deltas are invalidated. Make sure the next mouse move event
// starts over from an absolute baseline.
forceNextMouseMoveAbsolute
=
TRUE
;
}
-
(
void
)
applicationDidChangeScreenParameters
:
(
NSNotification
*
)
notification
{
primaryScreenHeightValid
=
FALSE
;
[
self
sendDisplaysChanged
:
FALSE
];
// When the display configuration changes, the cursor position may jump.
// Accumulated mouse movement deltas are invalidated. Make sure the next
// mouse move event starts over from an absolute baseline.
forceNextMouseMoveAbsolute
=
TRUE
;
}
-
(
void
)
applicationDidResignActive
:
(
NSNotification
*
)
notification
...
...
@@ -627,6 +667,8 @@ int macdrv_err_on;
NSWindow
*
window
=
[
note
object
];
[
keyWindows
removeObjectIdenticalTo
:
window
];
[
orderedWineWindows
removeObjectIdenticalTo
:
window
];
if
(
window
==
lastTargetWindow
)
lastTargetWindow
=
nil
;
}];
[
nc
addObserver
:
self
...
...
dlls/winemac.drv/cocoa_window.h
View file @
0a56ef35
...
...
@@ -48,7 +48,6 @@
NSUInteger
lastModifierFlags
;
BOOL
forceNextMouseMoveAbsolute
;
double
mouseMoveDeltaX
,
mouseMoveDeltaY
;
NSInteger
levelWhenActive
;
...
...
@@ -64,4 +63,6 @@
-
(
void
)
adjustWindowLevel
;
-
(
void
)
postMouseMovedEvent
:(
NSEvent
*
)
theEvent
absolute
:(
BOOL
)
absolute
;
@end
dlls/winemac.drv/cocoa_window.m
View file @
0a56ef35
...
...
@@ -264,7 +264,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
(
!
window
)
return
nil
;
window
->
normalStyleMask
=
[
window
styleMask
];
window
->
forceNextMouseMoveAbsolute
=
TRUE
;
/* Standardize windows to eliminate differences between titled and
borderless windows and between NSWindow and NSPanel. */
...
...
@@ -285,8 +284,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
contentView
setAutoresizesSubviews
:
NO
];
trackingArea
=
[[[
NSTrackingArea
alloc
]
initWithRect
:[
contentView
bounds
]
options
:(
NSTrackingMouseEnteredAndExited
|
NSTrackingMouseMoved
|
options
:(
NSTrackingMouseMoved
|
NSTrackingActiveAlways
|
NSTrackingInVisibleRect
)
owner
:
window
...
...
@@ -508,7 +506,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
{
self
.
latentParentWindow
=
[
self
parentWindow
];
[
latentParentWindow
removeChildWindow
:
self
];
forceNextMouseMoveAbsolute
=
TRUE
;
[
self
orderOut
:
nil
];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowOut
relativeTo
:
nil
];
[
NSApp
removeWindowsItem
:
self
];
...
...
@@ -739,11 +736,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
event
:
theEvent
];
}
-
(
void
)
postMouseMovedEvent
:
(
NSEvent
*
)
theEvent
-
(
void
)
postMouseMovedEvent
:
(
NSEvent
*
)
theEvent
absolute
:
(
BOOL
)
absolute
{
macdrv_event
event
;
if
(
forceNextMouseMoveA
bsolute
)
if
(
a
bsolute
)
{
CGPoint
point
=
CGEventGetLocation
([
theEvent
CGEvent
]);
...
...
@@ -753,8 +750,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
mouseMoveDeltaX
=
0
;
mouseMoveDeltaY
=
0
;
forceNextMouseMoveAbsolute
=
FALSE
;
}
else
{
...
...
@@ -961,14 +956,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
}
-
(
void
)
mouseEntered
:
(
NSEvent
*
)
theEvent
{
forceNextMouseMoveAbsolute
=
TRUE
;
}
-
(
void
)
mouseExited
:
(
NSEvent
*
)
theEvent
{
forceNextMouseMoveAbsolute
=
TRUE
;
}
-
(
void
)
mouseMoved
:
(
NSEvent
*
)
theEvent
{
[
self
postMouseMovedEvent
:
theEvent
];
}
-
(
void
)
mouseDragged
:
(
NSEvent
*
)
theEvent
{
[
self
postMouseMovedEvent
:
theEvent
];
}
-
(
void
)
rightMouseDragged
:
(
NSEvent
*
)
theEvent
{
[
self
postMouseMovedEvent
:
theEvent
];
}
-
(
void
)
otherMouseDragged
:
(
NSEvent
*
)
theEvent
{
[
self
postMouseMovedEvent
:
theEvent
];
}
-
(
void
)
scrollWheel
:
(
NSEvent
*
)
theEvent
{
CGPoint
pt
;
...
...
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