Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
05b29423
Commit
05b29423
authored
Jun 10, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move WM_NCCALCSIZE implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
81d04f93
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
104 deletions
+69
-104
controls.h
dlls/user32/controls.h
+0
-3
defwnd.c
dlls/user32/defwnd.c
+0
-4
menu.c
dlls/user32/menu.c
+0
-25
nonclient.c
dlls/user32/nonclient.c
+0
-70
defwnd.c
dlls/win32u/defwnd.c
+64
-0
menu.c
dlls/win32u/menu.c
+0
-0
sysparams.c
dlls/win32u/sysparams.c
+2
-2
win32u_private.h
dlls/win32u/win32u_private.h
+3
-0
No files found.
dlls/user32/controls.h
View file @
05b29423
...
...
@@ -114,8 +114,6 @@ extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DEC
/* menu controls */
extern
HWND
MENU_IsMenuActive
(
void
)
DECLSPEC_HIDDEN
;
extern
UINT
MENU_GetMenuBarHeight
(
HWND
hwnd
,
UINT
menubarWidth
,
INT
orgX
,
INT
orgY
)
DECLSPEC_HIDDEN
;
extern
void
MENU_TrackMouseMenuBar
(
HWND
hwnd
,
INT
ht
,
POINT
pt
)
DECLSPEC_HIDDEN
;
extern
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
WCHAR
wChar
)
DECLSPEC_HIDDEN
;
extern
UINT
MENU_DrawMenuBar
(
HDC
hDC
,
LPRECT
lprect
,
HWND
hwnd
)
DECLSPEC_HIDDEN
;
...
...
@@ -123,7 +121,6 @@ extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
extern
HMENU
MENU_GetSysMenu
(
HWND
hWnd
,
HMENU
hPopupMenu
)
DECLSPEC_HIDDEN
;
/* nonclient area */
extern
void
NC_HandleNCCalcSize
(
HWND
hwnd
,
WPARAM
wParam
,
RECT
*
winRect
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCHitTest
(
HWND
hwnd
,
POINT
pt
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCLButtonDown
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCMouseMove
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/defwnd.c
View file @
05b29423
...
...
@@ -173,10 +173,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return
NC_HandleNCHitTest
(
hwnd
,
pt
);
}
case
WM_NCCALCSIZE
:
NC_HandleNCCalcSize
(
hwnd
,
wParam
,
(
RECT
*
)
lParam
);
break
;
case
WM_WINDOWPOSCHANGED
:
DEFWND_HandleWindowPosChanged
(
hwnd
,
(
const
WINDOWPOS
*
)
lParam
);
break
;
...
...
dlls/user32/menu.c
View file @
05b29423
...
...
@@ -3506,31 +3506,6 @@ LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
/***********************************************************************
* MENU_GetMenuBarHeight
*
* Compute the size of the menu bar height. Used by NC_HandleNCCalcSize().
*/
UINT
MENU_GetMenuBarHeight
(
HWND
hwnd
,
UINT
menubarWidth
,
INT
orgX
,
INT
orgY
)
{
HDC
hdc
;
RECT
rectBar
;
LPPOPUPMENU
lppop
;
TRACE
(
"HWND %p, width %d, at (%d, %d).
\n
"
,
hwnd
,
menubarWidth
,
orgX
,
orgY
);
if
(
!
(
lppop
=
MENU_GetMenu
(
GetMenu
(
hwnd
)
)))
return
0
;
hdc
=
NtUserGetDCEx
(
hwnd
,
0
,
DCX_CACHE
|
DCX_WINDOW
);
SelectObject
(
hdc
,
get_menu_font
(
FALSE
));
SetRect
(
&
rectBar
,
orgX
,
orgY
,
orgX
+
menubarWidth
,
orgY
+
GetSystemMetrics
(
SM_CYMENU
));
MENU_MenuBarCalcSize
(
hdc
,
&
rectBar
,
lppop
,
hwnd
);
NtUserReleaseDC
(
hwnd
,
hdc
);
return
lppop
->
Height
;
}
/*******************************************************************
* ChangeMenuA (USER32.@)
*/
...
...
dlls/user32/nonclient.c
View file @
05b29423
...
...
@@ -342,76 +342,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectExForDpi( LPRECT rect, DWORD style
/***********************************************************************
* NC_HandleNCCalcSize
*
* Handle a WM_NCCALCSIZE message. Called from DefWindowProc().
*/
void
NC_HandleNCCalcSize
(
HWND
hwnd
,
WPARAM
wparam
,
RECT
*
winRect
)
{
RECT
tmpRect
=
{
0
,
0
,
0
,
0
};
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
LONG
exStyle
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
if
(
winRect
==
NULL
)
return
;
if
(
!
(
style
&
WS_MINIMIZE
))
{
AdjustWindowRectEx
(
&
tmpRect
,
style
,
FALSE
,
exStyle
&
~
WS_EX_CLIENTEDGE
);
winRect
->
left
-=
tmpRect
.
left
;
winRect
->
top
-=
tmpRect
.
top
;
winRect
->
right
-=
tmpRect
.
right
;
winRect
->
bottom
-=
tmpRect
.
bottom
;
if
(((
style
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
&&
GetMenu
(
hwnd
))
{
TRACE
(
"Calling GetMenuBarHeight with hwnd %p, width %ld, at (%ld, %ld).
\n
"
,
hwnd
,
winRect
->
right
-
winRect
->
left
,
-
tmpRect
.
left
,
-
tmpRect
.
top
);
winRect
->
top
+=
MENU_GetMenuBarHeight
(
hwnd
,
winRect
->
right
-
winRect
->
left
,
-
tmpRect
.
left
,
-
tmpRect
.
top
);
}
if
(
exStyle
&
WS_EX_CLIENTEDGE
)
if
(
winRect
->
right
-
winRect
->
left
>
2
*
GetSystemMetrics
(
SM_CXEDGE
)
&&
winRect
->
bottom
-
winRect
->
top
>
2
*
GetSystemMetrics
(
SM_CYEDGE
))
InflateRect
(
winRect
,
-
GetSystemMetrics
(
SM_CXEDGE
),
-
GetSystemMetrics
(
SM_CYEDGE
));
if
(
style
&
WS_VSCROLL
)
if
(
winRect
->
right
-
winRect
->
left
>=
GetSystemMetrics
(
SM_CXVSCROLL
))
{
/* rectangle is in screen coords when wparam is false */
if
(
!
wparam
&&
(
exStyle
&
WS_EX_LAYOUTRTL
))
exStyle
^=
WS_EX_LEFTSCROLLBAR
;
if
((
exStyle
&
WS_EX_LEFTSCROLLBAR
)
!=
0
)
winRect
->
left
+=
GetSystemMetrics
(
SM_CXVSCROLL
);
else
winRect
->
right
-=
GetSystemMetrics
(
SM_CXVSCROLL
);
}
if
(
style
&
WS_HSCROLL
)
if
(
winRect
->
bottom
-
winRect
->
top
>
GetSystemMetrics
(
SM_CYHSCROLL
))
winRect
->
bottom
-=
GetSystemMetrics
(
SM_CYHSCROLL
);
if
(
winRect
->
top
>
winRect
->
bottom
)
winRect
->
bottom
=
winRect
->
top
;
if
(
winRect
->
left
>
winRect
->
right
)
winRect
->
right
=
winRect
->
left
;
}
else
{
winRect
->
right
=
winRect
->
left
;
winRect
->
bottom
=
winRect
->
top
;
}
}
/***********************************************************************
* NC_GetInsideRect
*
* Get the 'inside' rectangle of a window, i.e. the whole window rectangle
...
...
dlls/win32u/defwnd.c
View file @
05b29423
...
...
@@ -1487,6 +1487,66 @@ static LRESULT handle_nc_activate( HWND hwnd, WPARAM wparam, LPARAM lparam )
return
TRUE
;
}
static
void
handle_nc_calc_size
(
HWND
hwnd
,
WPARAM
wparam
,
RECT
*
win_rect
)
{
RECT
rect
=
{
0
,
0
,
0
,
0
};
LONG
style
=
get_window_long
(
hwnd
,
GWL_STYLE
);
LONG
ex_style
=
get_window_long
(
hwnd
,
GWL_EXSTYLE
);
if
(
!
win_rect
)
return
;
if
(
!
(
style
&
WS_MINIMIZE
))
{
AdjustWindowRectEx
(
&
rect
,
style
,
FALSE
,
ex_style
&
~
WS_EX_CLIENTEDGE
);
win_rect
->
left
-=
rect
.
left
;
win_rect
->
top
-=
rect
.
top
;
win_rect
->
right
-=
rect
.
right
;
win_rect
->
bottom
-=
rect
.
bottom
;
if
(((
style
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
&&
get_menu
(
hwnd
))
{
TRACE
(
"getting menu bar height with hwnd %p, width %d, at (%d, %d)
\n
"
,
hwnd
,
win_rect
->
right
-
win_rect
->
left
,
-
rect
.
left
,
-
rect
.
top
);
win_rect
->
top
+=
get_menu_bar_height
(
hwnd
,
win_rect
->
right
-
win_rect
->
left
,
-
rect
.
left
,
-
rect
.
top
);
}
if
(
ex_style
&
WS_EX_CLIENTEDGE
)
if
(
win_rect
->
right
-
win_rect
->
left
>
2
*
get_system_metrics
(
SM_CXEDGE
)
&&
win_rect
->
bottom
-
win_rect
->
top
>
2
*
get_system_metrics
(
SM_CYEDGE
))
InflateRect
(
win_rect
,
-
get_system_metrics
(
SM_CXEDGE
),
-
get_system_metrics
(
SM_CYEDGE
));
if
((
style
&
WS_VSCROLL
)
&&
win_rect
->
right
-
win_rect
->
left
>=
get_system_metrics
(
SM_CXVSCROLL
))
{
/* rectangle is in screen coords when wparam is false */
if
(
!
wparam
&&
(
ex_style
&
WS_EX_LAYOUTRTL
))
ex_style
^=
WS_EX_LEFTSCROLLBAR
;
if
(
ex_style
&
WS_EX_LEFTSCROLLBAR
)
win_rect
->
left
+=
get_system_metrics
(
SM_CXVSCROLL
);
else
win_rect
->
right
-=
get_system_metrics
(
SM_CXVSCROLL
);
}
if
((
style
&
WS_HSCROLL
)
&&
win_rect
->
bottom
-
win_rect
->
top
>
get_system_metrics
(
SM_CYHSCROLL
))
{
win_rect
->
bottom
-=
get_system_metrics
(
SM_CYHSCROLL
);
}
if
(
win_rect
->
top
>
win_rect
->
bottom
)
win_rect
->
bottom
=
win_rect
->
top
;
if
(
win_rect
->
left
>
win_rect
->
right
)
win_rect
->
right
=
win_rect
->
left
;
}
else
{
win_rect
->
right
=
win_rect
->
left
;
win_rect
->
bottom
=
win_rect
->
top
;
}
}
LRESULT
default_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
)
{
LRESULT
result
=
0
;
...
...
@@ -1514,6 +1574,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
break
;
}
case
WM_NCCALCSIZE
:
handle_nc_calc_size
(
hwnd
,
wparam
,
(
RECT
*
)
lparam
);
break
;
case
WM_NCPAINT
:
return
handle_nc_paint
(
hwnd
,
(
HRGN
)
wparam
);
...
...
dlls/win32u/menu.c
View file @
05b29423
This diff is collapsed.
Click to expand it.
dlls/win32u/sysparams.c
View file @
05b29423
...
...
@@ -2724,7 +2724,7 @@ static void get_real_fontname( LOGFONTW *lf, WCHAR fullname[LF_FACESIZE] )
lstrcpyW
(
fullname
,
lf
->
lfFaceName
);
}
static
LONG
get_char_dimensions
(
HDC
hdc
,
TEXTMETRICW
*
metric
,
LONG
*
height
)
LONG
get_char_dimensions
(
HDC
hdc
,
TEXTMETRICW
*
metric
,
LONG
*
height
)
{
SIZE
sz
;
static
const
WCHAR
abcdW
[]
=
...
...
@@ -2763,7 +2763,7 @@ static void get_text_metr_size( HDC hdc, LOGFONTW *lf, TEXTMETRICW *metric, UINT
NtGdiDeleteObjectApp
(
hfont
);
}
static
DWORD
get_dialog_base_units
(
void
)
DWORD
get_dialog_base_units
(
void
)
{
static
LONG
cx
,
cy
;
...
...
dlls/win32u/win32u_private.h
View file @
05b29423
...
...
@@ -392,6 +392,7 @@ extern void update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN;
extern
HMENU
create_menu
(
BOOL
is_popup
)
DECLSPEC_HIDDEN
;
extern
BOOL
draw_menu_bar
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
HMENU
get_menu
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
UINT
get_menu_bar_height
(
HWND
hwnd
,
UINT
width
,
INT
org_x
,
INT
org_y
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_menu_info
(
HMENU
handle
,
MENUINFO
*
info
)
DECLSPEC_HIDDEN
;
extern
INT
get_menu_item_count
(
HMENU
handle
)
DECLSPEC_HIDDEN
;
extern
UINT
get_menu_state
(
HMENU
handle
,
UINT
item_id
,
UINT
flags
)
DECLSPEC_HIDDEN
;
...
...
@@ -413,6 +414,8 @@ extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM
/* sysparams.c */
extern
BOOL
enable_thunk_lock
DECLSPEC_HIDDEN
;
extern
HBRUSH
get_55aa_brush
(
void
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_dialog_base_units
(
void
)
DECLSPEC_HIDDEN
;
extern
LONG
get_char_dimensions
(
HDC
hdc
,
TEXTMETRICW
*
metric
,
LONG
*
height
)
DECLSPEC_HIDDEN
;
extern
RECT
get_display_rect
(
const
WCHAR
*
display
)
DECLSPEC_HIDDEN
;
extern
UINT
get_monitor_dpi
(
HMONITOR
monitor
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_monitor_info
(
HMONITOR
handle
,
MONITORINFO
*
info
)
DECLSPEC_HIDDEN
;
...
...
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