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
3eee5666
Commit
3eee5666
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: Mouse drags don't imply anything about z-order of target window because…
winemac: Mouse drags don't imply anything about z-order of target window because of implicit capture.
parent
3e3d9821
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+3
-1
cocoa_event.m
dlls/winemac.drv/cocoa_event.m
+2
-1
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-0
mouse.c
dlls/winemac.drv/mouse.c
+8
-8
No files found.
dlls/winemac.drv/cocoa_app.m
View file @
3eee5666
...
@@ -1157,12 +1157,13 @@ int macdrv_err_on;
...
@@ -1157,12 +1157,13 @@ int macdrv_err_on;
-
(
void
)
handleMouseMove
:
(
NSEvent
*
)
anEvent
-
(
void
)
handleMouseMove
:
(
NSEvent
*
)
anEvent
{
{
WineWindow
*
targetWindow
;
WineWindow
*
targetWindow
;
BOOL
drag
=
[
anEvent
type
]
!=
NSMouseMoved
;
/* Because of the way -[NSWindow setAcceptsMouseMovedEvents:] works, the
/* Because of the way -[NSWindow setAcceptsMouseMovedEvents:] works, the
event indicates its window is the main window, even if the cursor is
event indicates its window is the main window, even if the cursor is
over a different window. Find the actual WineWindow that is under the
over a different window. Find the actual WineWindow that is under the
cursor and post the event as being for that window. */
cursor and post the event as being for that window. */
if
(
[
anEvent
type
]
==
NSMouseMoved
)
if
(
!
drag
)
{
{
CGPoint
cgpoint
=
CGEventGetLocation
([
anEvent
CGEvent
]);
CGPoint
cgpoint
=
CGEventGetLocation
([
anEvent
CGEvent
]);
NSPoint
point
=
[
self
flippedMouseLocation
:
NSPointFromCGPoint
(
cgpoint
)];
NSPoint
point
=
[
self
flippedMouseLocation
:
NSPointFromCGPoint
(
cgpoint
)];
...
@@ -1276,6 +1277,7 @@ int macdrv_err_on;
...
@@ -1276,6 +1277,7 @@ int macdrv_err_on;
if
(
event
->
type
==
MOUSE_MOVED_ABSOLUTE
||
event
->
mouse_moved
.
x
||
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
]];
event
->
mouse_moved
.
time_ms
=
[
self
ticksForEventTime
:[
anEvent
timestamp
]];
event
->
mouse_moved
.
drag
=
drag
;
[
targetWindow
.
queue
postEvent
:
event
];
[
targetWindow
.
queue
postEvent
:
event
];
}
}
...
...
dlls/winemac.drv/cocoa_event.m
View file @
3eee5666
...
@@ -162,7 +162,8 @@ static NSString* const WineEventQueueThreadDictionaryKey = @"WineEventQueueThrea
...
@@ -162,7 +162,8 @@ static NSString* const WineEventQueueThreadDictionaryKey = @"WineEventQueueThrea
(
lastEvent
=
[
events
lastObject
])
&&
(
lastEvent
=
[
events
lastObject
])
&&
(
lastEvent
->
event
->
type
==
MOUSE_MOVED
||
(
lastEvent
->
event
->
type
==
MOUSE_MOVED
||
lastEvent
->
event
->
type
==
MOUSE_MOVED_ABSOLUTE
)
&&
lastEvent
->
event
->
type
==
MOUSE_MOVED_ABSOLUTE
)
&&
lastEvent
->
event
->
window
==
event
->
event
->
window
)
lastEvent
->
event
->
window
==
event
->
event
->
window
&&
lastEvent
->
event
->
mouse_moved
.
drag
==
event
->
event
->
mouse_moved
.
drag
)
{
{
if
(
event
->
event
->
type
==
MOUSE_MOVED
)
if
(
event
->
event
->
type
==
MOUSE_MOVED
)
{
{
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
3eee5666
...
@@ -227,6 +227,7 @@ typedef struct macdrv_event {
...
@@ -227,6 +227,7 @@ typedef struct macdrv_event {
struct
{
struct
{
int
x
;
int
x
;
int
y
;
int
y
;
int
drag
;
unsigned
long
time_ms
;
unsigned
long
time_ms
;
}
mouse_moved
;
}
mouse_moved
;
struct
{
struct
{
...
...
dlls/winemac.drv/mouse.c
View file @
3eee5666
...
@@ -134,14 +134,14 @@ static const CFStringRef cocoa_cursor_names[] =
...
@@ -134,14 +134,14 @@ static const CFStringRef cocoa_cursor_names[] =
* Update the various window states on a mouse event.
* Update the various window states on a mouse event.
*/
*/
static
void
send_mouse_input
(
HWND
hwnd
,
UINT
flags
,
int
x
,
int
y
,
static
void
send_mouse_input
(
HWND
hwnd
,
UINT
flags
,
int
x
,
int
y
,
DWORD
mouse_data
,
unsigned
long
time
)
DWORD
mouse_data
,
BOOL
drag
,
unsigned
long
time
)
{
{
INPUT
input
;
INPUT
input
;
HWND
top_level_hwnd
;
HWND
top_level_hwnd
;
top_level_hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
);
top_level_hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
);
if
((
flags
&
MOUSEEVENTF_MOVE
)
&&
(
flags
&
MOUSEEVENTF_ABSOLUTE
))
if
((
flags
&
MOUSEEVENTF_MOVE
)
&&
(
flags
&
MOUSEEVENTF_ABSOLUTE
)
&&
!
drag
)
{
{
RECT
rect
;
RECT
rect
;
...
@@ -854,7 +854,7 @@ void macdrv_mouse_button(HWND hwnd, const macdrv_event *event)
...
@@ -854,7 +854,7 @@ void macdrv_mouse_button(HWND hwnd, const macdrv_event *event)
send_mouse_input
(
hwnd
,
flags
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
send_mouse_input
(
hwnd
,
flags
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
event
->
mouse_button
.
x
,
event
->
mouse_button
.
y
,
event
->
mouse_button
.
x
,
event
->
mouse_button
.
y
,
data
,
event
->
mouse_button
.
time_ms
);
data
,
FALSE
,
event
->
mouse_button
.
time_ms
);
}
}
...
@@ -867,16 +867,16 @@ void macdrv_mouse_moved(HWND hwnd, const macdrv_event *event)
...
@@ -867,16 +867,16 @@ void macdrv_mouse_moved(HWND hwnd, const macdrv_event *event)
{
{
UINT
flags
=
MOUSEEVENTF_MOVE
;
UINT
flags
=
MOUSEEVENTF_MOVE
;
TRACE
(
"win %p/%p %s (%d,%d) time %lu (%lu ticks ago)
\n
"
,
hwnd
,
event
->
window
,
TRACE
(
"win %p/%p %s (%d,%d)
drag %d
time %lu (%lu ticks ago)
\n
"
,
hwnd
,
event
->
window
,
(
event
->
type
==
MOUSE_MOVED
)
?
"relative"
:
"absolute"
,
(
event
->
type
==
MOUSE_MOVED
)
?
"relative"
:
"absolute"
,
event
->
mouse_moved
.
x
,
event
->
mouse_moved
.
y
,
event
->
mouse_moved
.
x
,
event
->
mouse_moved
.
y
,
event
->
mouse_moved
.
drag
,
event
->
mouse_moved
.
time_ms
,
(
GetTickCount
()
-
event
->
mouse_moved
.
time_ms
));
event
->
mouse_moved
.
time_ms
,
(
GetTickCount
()
-
event
->
mouse_moved
.
time_ms
));
if
(
event
->
type
==
MOUSE_MOVED_ABSOLUTE
)
if
(
event
->
type
==
MOUSE_MOVED_ABSOLUTE
)
flags
|=
MOUSEEVENTF_ABSOLUTE
;
flags
|=
MOUSEEVENTF_ABSOLUTE
;
send_mouse_input
(
hwnd
,
flags
,
event
->
mouse_moved
.
x
,
event
->
mouse_moved
.
y
,
send_mouse_input
(
hwnd
,
flags
,
event
->
mouse_moved
.
x
,
event
->
mouse_moved
.
y
,
0
,
event
->
mouse_moved
.
time_ms
);
0
,
event
->
mouse_moved
.
drag
,
event
->
mouse_moved
.
time_ms
);
}
}
...
@@ -894,8 +894,8 @@ void macdrv_mouse_scroll(HWND hwnd, const macdrv_event *event)
...
@@ -894,8 +894,8 @@ void macdrv_mouse_scroll(HWND hwnd, const macdrv_event *event)
send_mouse_input
(
hwnd
,
MOUSEEVENTF_WHEEL
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
send_mouse_input
(
hwnd
,
MOUSEEVENTF_WHEEL
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
event
->
mouse_scroll
.
x
,
event
->
mouse_scroll
.
y
,
event
->
mouse_scroll
.
x
,
event
->
mouse_scroll
.
y
,
event
->
mouse_scroll
.
y_scroll
,
event
->
mouse_scroll
.
time_ms
);
event
->
mouse_scroll
.
y_scroll
,
FALSE
,
event
->
mouse_scroll
.
time_ms
);
send_mouse_input
(
hwnd
,
MOUSEEVENTF_HWHEEL
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
send_mouse_input
(
hwnd
,
MOUSEEVENTF_HWHEEL
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
event
->
mouse_scroll
.
x
,
event
->
mouse_scroll
.
y
,
event
->
mouse_scroll
.
x
,
event
->
mouse_scroll
.
y
,
event
->
mouse_scroll
.
x_scroll
,
event
->
mouse_scroll
.
time_ms
);
event
->
mouse_scroll
.
x_scroll
,
FALSE
,
event
->
mouse_scroll
.
time_ms
);
}
}
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