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
5dea6543
Commit
5dea6543
authored
Nov 14, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Properly set last error in MapWindowPoints.
parent
fb1c533e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
winpos.c
dlls/user32/winpos.c
+24
-12
No files found.
dlls/user32/winpos.c
View file @
5dea6543
...
...
@@ -422,11 +422,11 @@ HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
* Calculate the offset between the origin of the two windows. Used
* to implement MapWindowPoints.
*/
static
POINT
WINPOS_GetWinOffset
(
HWND
hwndFrom
,
HWND
hwndTo
,
BOOL
*
mirrored
)
static
BOOL
WINPOS_GetWinOffset
(
HWND
hwndFrom
,
HWND
hwndTo
,
BOOL
*
mirrored
,
POINT
*
ret_offset
)
{
WND
*
wndPtr
;
POINT
offset
;
BOOL
mirror_from
,
mirror_to
;
BOOL
mirror_from
,
mirror_to
,
ret
;
HWND
hwnd
;
offset
.
x
=
offset
.
y
=
0
;
...
...
@@ -435,7 +435,11 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
/* Translate source window origin to screen coords */
if
(
hwndFrom
)
{
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwndFrom
)))
return
offset
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwndFrom
)))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
)
goto
other_process
;
if
(
wndPtr
!=
WND_DESKTOP
)
{
...
...
@@ -466,7 +470,11 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
/* Translate origin to destination window coords */
if
(
hwndTo
)
{
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwndTo
)))
return
offset
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwndTo
)))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
)
goto
other_process
;
if
(
wndPtr
!=
WND_DESKTOP
)
{
...
...
@@ -496,35 +504,37 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
*
mirrored
=
mirror_from
^
mirror_to
;
if
(
mirror_from
)
offset
.
x
=
-
offset
.
x
;
return
offset
;
*
ret_offset
=
offset
;
return
TRUE
;
other_process:
/* one of the parents may belong to another process, do it the hard way */
offset
.
x
=
offset
.
y
=
0
;
SERVER_START_REQ
(
get_windows_offset
)
{
req
->
from
=
wine_server_user_handle
(
hwndFrom
);
req
->
to
=
wine_server_user_handle
(
hwndTo
);
if
(
!
wine_server_call
(
req
))
if
(
(
ret
=
!
wine_server_call_err
(
req
)
))
{
offset
.
x
=
reply
->
x
;
offset
.
y
=
reply
->
y
;
ret_offset
->
x
=
reply
->
x
;
ret_offset
->
y
=
reply
->
y
;
*
mirrored
=
reply
->
mirror
;
}
}
SERVER_END_REQ
;
return
offs
et
;
return
r
et
;
}
/* map coordinates of a window region */
void
map_window_region
(
HWND
from
,
HWND
to
,
HRGN
hrgn
)
{
BOOL
mirrored
;
POINT
offset
=
WINPOS_GetWinOffset
(
from
,
to
,
&
mirrored
)
;
POINT
offset
;
UINT
i
,
size
;
RGNDATA
*
data
;
HRGN
new_rgn
;
RECT
*
rect
;
if
(
!
WINPOS_GetWinOffset
(
from
,
to
,
&
mirrored
,
&
offset
))
return
;
if
(
!
mirrored
)
{
OffsetRgn
(
hrgn
,
offset
.
x
,
offset
.
y
);
...
...
@@ -557,9 +567,11 @@ void map_window_region( HWND from, HWND to, HRGN hrgn )
INT
WINAPI
MapWindowPoints
(
HWND
hwndFrom
,
HWND
hwndTo
,
LPPOINT
lppt
,
UINT
count
)
{
BOOL
mirrored
;
POINT
offset
=
WINPOS_GetWinOffset
(
hwndFrom
,
hwndTo
,
&
mirrored
)
;
POINT
offset
;
UINT
i
;
if
(
!
WINPOS_GetWinOffset
(
hwndFrom
,
hwndTo
,
&
mirrored
,
&
offset
))
return
0
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
lppt
[
i
].
x
+=
offset
.
x
;
...
...
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