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
c5bf4976
Commit
c5bf4976
authored
Sep 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Pass the window styles to NC_GetInsideRect instead of accessing the window structure.
parent
7295b674
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
24 deletions
+30
-24
nonclient.c
dlls/user32/nonclient.c
+30
-24
No files found.
dlls/user32/nonclient.c
View file @
c5bf4976
...
...
@@ -479,7 +479,7 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
* but without the borders (if any).
* The rectangle is in window coordinates (for drawing with GetWindowDC()).
*/
static
void
NC_GetInsideRect
(
HWND
hwnd
,
RECT
*
rect
)
static
void
NC_GetInsideRect
(
HWND
hwnd
,
RECT
*
rect
,
DWORD
style
,
DWORD
ex_style
)
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
...
...
@@ -489,30 +489,29 @@ static void NC_GetInsideRect( HWND hwnd, RECT *rect )
rect
->
right
=
wndPtr
->
rectWindow
.
right
-
wndPtr
->
rectWindow
.
left
;
rect
->
bottom
=
wndPtr
->
rectWindow
.
bottom
-
wndPtr
->
rectWindow
.
top
;
if
(
wndPtr
->
dwS
tyle
&
WS_ICONIC
)
goto
END
;
if
(
s
tyle
&
WS_ICONIC
)
goto
END
;
/* Remove frame from rectangle */
if
(
HAS_THICKFRAME
(
wndPtr
->
dwStyle
,
wndPtr
->
dwExS
tyle
))
if
(
HAS_THICKFRAME
(
style
,
ex_s
tyle
))
{
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXFRAME
),
-
GetSystemMetrics
(
SM_CYFRAME
)
);
}
else
if
(
HAS_DLGFRAME
(
wndPtr
->
dwStyle
,
wndPtr
->
dwExS
tyle
))
else
if
(
HAS_DLGFRAME
(
style
,
ex_s
tyle
))
{
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXDLGFRAME
),
-
GetSystemMetrics
(
SM_CYDLGFRAME
));
}
else
if
(
HAS_THINFRAME
(
wndPtr
->
dwS
tyle
))
else
if
(
HAS_THINFRAME
(
s
tyle
))
{
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXBORDER
),
-
GetSystemMetrics
(
SM_CYBORDER
)
);
}
/* We have additional border information if the window
* is a child (but not an MDI child) */
if
(
(
wndPtr
->
dwStyle
&
WS_CHILD
)
&&
(
(
wndPtr
->
dwExStyle
&
WS_EX_MDICHILD
)
==
0
)
)
if
((
style
&
WS_CHILD
)
&&
!
(
ex_style
&
WS_EX_MDICHILD
))
{
if
(
wndPtr
->
dwExS
tyle
&
WS_EX_CLIENTEDGE
)
if
(
ex_s
tyle
&
WS_EX_CLIENTEDGE
)
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXEDGE
),
-
GetSystemMetrics
(
SM_CYEDGE
));
if
(
wndPtr
->
dwExS
tyle
&
WS_EX_STATICEDGE
)
if
(
ex_s
tyle
&
WS_EX_STATICEDGE
)
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXBORDER
),
-
GetSystemMetrics
(
SM_CYBORDER
));
}
...
...
@@ -706,7 +705,10 @@ BOOL NC_DrawSysButton (HWND hwnd, HDC hdc, BOOL down)
if
(
hIcon
)
{
RECT
rect
;
NC_GetInsideRect
(
hwnd
,
&
rect
);
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
ex_style
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
NC_GetInsideRect
(
hwnd
,
&
rect
,
style
,
ex_style
);
DrawIconEx
(
hdc
,
rect
.
left
+
2
,
rect
.
top
+
1
,
hIcon
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
0
,
0
,
DI_NORMAL
);
...
...
@@ -728,11 +730,13 @@ BOOL NC_DrawSysButton (HWND hwnd, HDC hdc, BOOL down)
static
void
NC_DrawCloseButton
(
HWND
hwnd
,
HDC
hdc
,
BOOL
down
,
BOOL
bGrayed
)
{
RECT
rect
;
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
ex_style
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
NC_GetInsideRect
(
hwnd
,
&
rect
);
NC_GetInsideRect
(
hwnd
,
&
rect
,
style
,
ex_style
);
/* A tool window has a smaller Close button */
if
(
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_TOOLWINDOW
)
if
(
ex_style
&
WS_EX_TOOLWINDOW
)
{
INT
iBmpHeight
=
11
;
/* Windows does not use SM_CXSMSIZE and SM_CYSMSIZE */
INT
iBmpWidth
=
11
;
/* it uses 11x11 for the close button in tool window */
...
...
@@ -766,15 +770,16 @@ static void NC_DrawMaxButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
{
RECT
rect
;
UINT
flags
;
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
ex_style
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
/* never draw maximize box when window has WS_EX_TOOLWINDOW style */
if
(
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_TOOLWINDOW
)
return
;
if
(
ex_style
&
WS_EX_TOOLWINDOW
)
return
;
flags
=
IsZoomed
(
hwnd
)
?
DFCS_CAPTIONRESTORE
:
DFCS_CAPTIONMAX
;
flags
=
(
style
&
WS_MAXIMIZE
)
?
DFCS_CAPTIONRESTORE
:
DFCS_CAPTIONMAX
;
NC_GetInsideRect
(
hwnd
,
&
rect
);
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_SYSMENU
)
NC_GetInsideRect
(
hwnd
,
&
rect
,
style
,
ex_style
);
if
(
style
&
WS_SYSMENU
)
rect
.
right
-=
GetSystemMetrics
(
SM_CXSIZE
);
rect
.
left
=
rect
.
right
-
GetSystemMetrics
(
SM_CXSIZE
);
rect
.
bottom
=
rect
.
top
+
GetSystemMetrics
(
SM_CYSIZE
)
-
2
;
...
...
@@ -796,12 +801,12 @@ static void NC_DrawMinButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
RECT
rect
;
UINT
flags
=
DFCS_CAPTIONMIN
;
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
ex_style
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
/* never draw minimize box when window has WS_EX_TOOLWINDOW style */
if
(
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_TOOLWINDOW
)
return
;
if
(
ex_style
&
WS_EX_TOOLWINDOW
)
return
;
NC_GetInsideRect
(
hwnd
,
&
rect
);
NC_GetInsideRect
(
hwnd
,
&
rect
,
style
,
ex_style
);
if
(
style
&
WS_SYSMENU
)
rect
.
right
-=
GetSystemMetrics
(
SM_CXSIZE
);
if
(
style
&
(
WS_MAXIMIZEBOX
|
WS_MINIMIZEBOX
))
...
...
@@ -1215,13 +1220,14 @@ void NC_GetSysPopupPos( HWND hwnd, RECT* rect )
if
(
IsIconic
(
hwnd
))
GetWindowRect
(
hwnd
,
rect
);
else
{
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
ex_style
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
;
NC_GetInsideRect
(
hwnd
,
rect
);
NC_GetInsideRect
(
hwnd
,
rect
,
style
,
ex_style
);
OffsetRect
(
rect
,
wndPtr
->
rectWindow
.
left
,
wndPtr
->
rectWindow
.
top
);
if
(
wndPtr
->
dwStyle
&
WS_CHILD
)
ClientToScreen
(
GetParent
(
hwnd
),
(
POINT
*
)
rect
);
if
(
style
&
WS_CHILD
)
ClientToScreen
(
GetParent
(
hwnd
),
(
POINT
*
)
rect
);
rect
->
right
=
rect
->
left
+
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
rect
->
bottom
=
rect
->
top
+
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
WIN_ReleasePtr
(
wndPtr
);
...
...
@@ -1643,7 +1649,7 @@ BOOL WINAPI GetTitleBarInfo(HWND hwnd, PTITLEBARINFO tbi) {
}
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
dwExStyle
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
NC_GetInsideRect
(
hwnd
,
&
tbi
->
rcTitleBar
);
NC_GetInsideRect
(
hwnd
,
&
tbi
->
rcTitleBar
,
dwStyle
,
dwExStyle
);
GetWindowRect
(
hwnd
,
&
wndRect
);
...
...
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