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
0df8855b
Commit
0df8855b
authored
Sep 24, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use screen coordinates for hittest checking to handle RTL windows correctly.
parent
deb83097
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
14 deletions
+50
-14
nonclient.c
dlls/user32/nonclient.c
+50
-14
No files found.
dlls/user32/nonclient.c
View file @
0df8855b
...
@@ -527,8 +527,7 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
...
@@ -527,8 +527,7 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
TRACE
(
"hwnd=%p pt=%d,%d
\n
"
,
hwnd
,
pt
.
x
,
pt
.
y
);
TRACE
(
"hwnd=%p pt=%d,%d
\n
"
,
hwnd
,
pt
.
x
,
pt
.
y
);
ScreenToClient
(
hwnd
,
&
pt
);
WIN_GetRectangles
(
hwnd
,
COORDS_SCREEN
,
&
rect
,
&
rcClient
);
WIN_GetRectangles
(
hwnd
,
COORDS_CLIENT
,
&
rect
,
&
rcClient
);
if
(
!
PtInRect
(
&
rect
,
pt
))
return
HTNOWHERE
;
if
(
!
PtInRect
(
&
rect
,
pt
))
return
HTNOWHERE
;
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
...
@@ -594,36 +593,81 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
...
@@ -594,36 +593,81 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
{
{
BOOL
min_or_max_box
=
(
style
&
WS_MAXIMIZEBOX
)
||
BOOL
min_or_max_box
=
(
style
&
WS_MAXIMIZEBOX
)
||
(
style
&
WS_MINIMIZEBOX
);
(
style
&
WS_MINIMIZEBOX
);
if
(
ex_style
&
WS_EX_LAYOUTRTL
)
{
/* Check system menu */
/* Check system menu */
if
((
style
&
WS_SYSMENU
)
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
if
((
style
&
WS_SYSMENU
)
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
)
&&
NC_IconForWindow
(
hwnd
))
{
rect
.
right
-=
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
if
(
pt
.
x
>
rect
.
right
)
return
HTSYSMENU
;
}
/* Check close button */
if
(
style
&
WS_SYSMENU
)
{
{
if
(
NC_IconForWindow
(
hwnd
))
rect
.
left
+=
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
rect
.
left
+=
GetSystemMetrics
(
SM_CYCAPTION
);
if
(
pt
.
x
<
rect
.
left
)
return
HTCLOSE
;
}
}
/* Check maximize box */
/* In win95 there is automatically a Maximize button when there is a minimize one*/
if
(
min_or_max_box
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
{
rect
.
left
+=
GetSystemMetrics
(
SM_CXSIZE
);
if
(
pt
.
x
<
rect
.
left
)
return
HTMAXBUTTON
;
}
/* Check minimize box */
if
(
min_or_max_box
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
{
rect
.
left
+=
GetSystemMetrics
(
SM_CXSIZE
);
if
(
pt
.
x
<
rect
.
left
)
return
HTMINBUTTON
;
}
}
else
{
/* Check system menu */
if
((
style
&
WS_SYSMENU
)
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
)
&&
NC_IconForWindow
(
hwnd
))
{
rect
.
left
+=
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
if
(
pt
.
x
<
rect
.
left
)
return
HTSYSMENU
;
if
(
pt
.
x
<
rect
.
left
)
return
HTSYSMENU
;
}
/* Check close button */
/* Check close button */
if
(
style
&
WS_SYSMENU
)
if
(
style
&
WS_SYSMENU
)
{
rect
.
right
-=
GetSystemMetrics
(
SM_CYCAPTION
);
rect
.
right
-=
GetSystemMetrics
(
SM_CYCAPTION
);
if
(
pt
.
x
>
rect
.
right
)
return
HTCLOSE
;
if
(
pt
.
x
>
rect
.
right
)
return
HTCLOSE
;
}
/* Check maximize box */
/* Check maximize box */
/* In win95 there is automatically a Maximize button when there is a minimize one*/
/* In win95 there is automatically a Maximize button when there is a minimize one*/
if
(
min_or_max_box
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
if
(
min_or_max_box
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
{
rect
.
right
-=
GetSystemMetrics
(
SM_CXSIZE
);
rect
.
right
-=
GetSystemMetrics
(
SM_CXSIZE
);
if
(
pt
.
x
>
rect
.
right
)
return
HTMAXBUTTON
;
if
(
pt
.
x
>
rect
.
right
)
return
HTMAXBUTTON
;
}
/* Check minimize box */
/* Check minimize box */
/* In win95 there is automatically a Maximize button when there is a Maximize one*/
if
(
min_or_max_box
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
if
(
min_or_max_box
&&
!
(
ex_style
&
WS_EX_TOOLWINDOW
))
{
rect
.
right
-=
GetSystemMetrics
(
SM_CXSIZE
);
rect
.
right
-=
GetSystemMetrics
(
SM_CXSIZE
);
if
(
pt
.
x
>
rect
.
right
)
return
HTMINBUTTON
;
if
(
pt
.
x
>
rect
.
right
)
return
HTMINBUTTON
;
}
}
return
HTCAPTION
;
return
HTCAPTION
;
}
}
}
}
/* Check menu bar */
if
(
HAS_MENU
(
hwnd
,
style
)
&&
(
pt
.
y
<
rcClient
.
top
)
&&
(
pt
.
x
>=
rcClient
.
left
)
&&
(
pt
.
x
<
rcClient
.
right
))
return
HTMENU
;
/* Check vertical scroll bar */
/* Check vertical scroll bar */
if
(
ex_style
&
WS_EX_LAYOUTRTL
)
ex_style
^=
WS_EX_LEFTSCROLLBAR
;
if
(
style
&
WS_VSCROLL
)
if
(
style
&
WS_VSCROLL
)
{
{
if
((
ex_style
&
WS_EX_LEFTSCROLLBAR
)
!=
0
)
if
((
ex_style
&
WS_EX_LEFTSCROLLBAR
)
!=
0
)
...
@@ -649,14 +693,6 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
...
@@ -649,14 +693,6 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
}
}
}
}
/* Check menu bar */
if
(
HAS_MENU
(
hwnd
,
style
))
{
if
((
pt
.
y
<
0
)
&&
(
pt
.
x
>=
0
)
&&
(
pt
.
x
<
rcClient
.
right
))
return
HTMENU
;
}
/* Has to return HTNOWHERE if nothing was found
/* Has to return HTNOWHERE if nothing was found
Could happen when a window has a customized non client area */
Could happen when a window has a customized non client area */
return
HTNOWHERE
;
return
HTNOWHERE
;
...
...
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