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
9f03d8f3
Commit
9f03d8f3
authored
Jun 10, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move WM_NCPAINT handling from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
952affea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
58 additions
and
48 deletions
+58
-48
controls.h
dlls/user32/controls.h
+0
-1
defwnd.c
dlls/user32/defwnd.c
+0
-20
nonclient.c
dlls/user32/nonclient.c
+0
-23
user_main.c
dlls/user32/user_main.c
+9
-0
dc.c
dlls/win32u/dc.c
+5
-0
defwnd.c
dlls/win32u/defwnd.c
+0
-0
font.c
dlls/win32u/font.c
+22
-0
menu.c
dlls/win32u/menu.c
+1
-1
ntuser_private.h
dlls/win32u/ntuser_private.h
+2
-0
sysparams.c
dlls/win32u/sysparams.c
+3
-3
win32u_private.h
dlls/win32u/win32u_private.h
+4
-0
ntgdi.h
include/ntgdi.h
+1
-0
ntuser.h
include/ntuser.h
+11
-0
No files found.
dlls/user32/controls.h
View file @
9f03d8f3
...
...
@@ -123,7 +123,6 @@ extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
extern
HMENU
MENU_GetSysMenu
(
HWND
hWnd
,
HMENU
hPopupMenu
)
DECLSPEC_HIDDEN
;
/* nonclient area */
extern
LRESULT
NC_HandleNCPaint
(
HWND
hwnd
,
HRGN
clip
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCActivate
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
extern
void
NC_HandleNCCalcSize
(
HWND
hwnd
,
WPARAM
wParam
,
RECT
*
winRect
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCHitTest
(
HWND
hwnd
,
POINT
pt
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/defwnd.c
View file @
9f03d8f3
...
...
@@ -159,9 +159,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
{
switch
(
msg
)
{
case
WM_NCPAINT
:
return
NC_HandleNCPaint
(
hwnd
,
(
HRGN
)
wParam
);
case
WM_NCMOUSEMOVE
:
return
NC_HandleNCMouseMove
(
hwnd
,
wParam
,
lParam
);
...
...
@@ -422,15 +419,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case
WM_QUERYENDSESSION
:
return
1
;
case
WM_SETICON
:
{
LRESULT
res
=
NtUserMessageCall
(
hwnd
,
msg
,
wParam
,
lParam
,
0
,
NtUserDefWindowProc
,
FALSE
);
if
(
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CAPTION
)
==
WS_CAPTION
)
NC_HandleNCPaint
(
hwnd
,
(
HRGN
)
1
);
/* Repaint caption */
return
res
;
}
case
WM_HELP
:
SendMessageW
(
GetParent
(
hwnd
),
msg
,
wParam
,
lParam
);
break
;
...
...
@@ -590,8 +578,6 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
case
WM_SETTEXT
:
result
=
NtUserMessageCall
(
hwnd
,
msg
,
wParam
,
lParam
,
0
,
NtUserDefWindowProc
,
TRUE
);
if
(
result
&&
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CAPTION
)
==
WS_CAPTION
)
NC_HandleNCPaint
(
hwnd
,
(
HRGN
)
1
);
/* Repaint caption */
break
;
case
WM_IME_CHAR
:
...
...
@@ -767,12 +753,6 @@ LRESULT WINAPI DefWindowProcW(
}
break
;
case
WM_SETTEXT
:
result
=
NtUserMessageCall
(
hwnd
,
msg
,
wParam
,
lParam
,
0
,
NtUserDefWindowProc
,
FALSE
);
if
(
result
&&
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CAPTION
)
==
WS_CAPTION
)
NC_HandleNCPaint
(
hwnd
,
(
HRGN
)
1
);
/* Repaint caption */
break
;
case
WM_IME_CHAR
:
PostMessageW
(
hwnd
,
WM_CHAR
,
wParam
,
lParam
);
break
;
...
...
dlls/user32/nonclient.c
View file @
9f03d8f3
...
...
@@ -1074,29 +1074,6 @@ static void NC_DoNCPaint( HWND hwnd, HRGN clip )
}
/***********************************************************************
* NC_HandleNCPaint
*
* Handle a WM_NCPAINT message. Called from DefWindowProc().
*/
LRESULT
NC_HandleNCPaint
(
HWND
hwnd
,
HRGN
clip
)
{
HWND
parent
=
NtUserGetAncestor
(
hwnd
,
GA_PARENT
);
DWORD
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
(
dwStyle
&
WS_VISIBLE
)
{
NC_DoNCPaint
(
hwnd
,
clip
);
if
(
parent
==
GetDesktopWindow
())
PostMessageW
(
parent
,
WM_PARENTNOTIFY
,
WM_NCPAINT
,
(
LPARAM
)
hwnd
);
}
return
0
;
}
/***********************************************************************
* NC_HandleNCActivate
*
...
...
dlls/user32/user_main.c
View file @
9f03d8f3
...
...
@@ -145,6 +145,8 @@ static const struct user_callbacks user_funcs =
ImmProcessKey
,
ImmTranslateMessage
,
NtWaitForMultipleObjects
,
MENU_DrawMenuBar
,
SCROLL_DrawNCScrollBar
,
free_win_ptr
,
MENU_GetSysMenu
,
MENU_IsMenuActive
,
...
...
@@ -164,6 +166,12 @@ static NTSTATUS WINAPI User32CopyImage( const struct copy_image_params *params,
return
HandleToUlong
(
ret
);
}
static
NTSTATUS
WINAPI
User32DrawText
(
const
struct
draw_text_params
*
params
,
ULONG
size
)
{
size
-=
FIELD_OFFSET
(
struct
draw_text_params
,
str
);
return
DrawTextW
(
params
->
hdc
,
params
->
str
,
size
/
sizeof
(
WCHAR
),
params
->
rect
,
params
->
flags
);
}
static
NTSTATUS
WINAPI
User32LoadImage
(
const
struct
load_image_params
*
params
,
ULONG
size
)
{
HANDLE
ret
=
LoadImageW
(
params
->
hinst
,
params
->
name
,
params
->
type
,
...
...
@@ -198,6 +206,7 @@ static const void *kernel_callback_table[NtUserCallCount] =
User32CallWindowProc
,
User32CallWindowsHook
,
User32CopyImage
,
User32DrawText
,
User32FreeCachedClipboardData
,
User32LoadDriver
,
User32LoadImage
,
...
...
dlls/win32u/dc.c
View file @
9f03d8f3
...
...
@@ -966,6 +966,11 @@ BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD *pre
dc
->
attr
->
rop_mode
=
value
;
break
;
case
NtGdiSetTextAlign
:
prev
=
dc
->
attr
->
text_align
;
dc
->
attr
->
text_align
=
value
;
break
;
default:
WARN
(
"unknown method %u
\n
"
,
method
);
ret
=
FALSE
;
...
...
dlls/win32u/defwnd.c
View file @
9f03d8f3
This diff is collapsed.
Click to expand it.
dlls/win32u/font.c
View file @
9f03d8f3
...
...
@@ -6573,3 +6573,25 @@ BOOL WINAPI NtGdiGetCharWidthInfo( HDC hdc, struct char_width_info *info )
release_dc_ptr
(
dc
);
return
ret
;
}
/***********************************************************************
* DrawTextW (win32u.so)
*/
INT
WINAPI
DrawTextW
(
HDC
hdc
,
const
WCHAR
*
str
,
INT
count
,
RECT
*
rect
,
UINT
flags
)
{
struct
draw_text_params
*
params
;
ULONG
ret_len
,
size
;
void
*
ret_ptr
;
int
ret
;
if
(
count
==
-
1
)
count
=
wcslen
(
str
);
size
=
FIELD_OFFSET
(
struct
draw_text_params
,
str
[
count
]
);
if
(
!
(
params
=
malloc
(
size
)))
return
0
;
params
->
hdc
=
hdc
;
params
->
rect
=
rect
;
params
->
flags
=
flags
;
if
(
count
)
memcpy
(
params
->
str
,
str
,
count
*
sizeof
(
WCHAR
)
);
ret
=
KeUserModeCallback
(
NtUserDrawText
,
params
,
size
,
&
ret_ptr
,
&
ret_len
);
free
(
params
);
return
ret
;
}
dlls/win32u/menu.c
View file @
9f03d8f3
...
...
@@ -824,7 +824,7 @@ static BOOL set_menu_item_info( MENUITEM *menu, const MENUITEMINFOW *info )
}
/* see GetMenuState */
static
UINT
get_menu_state
(
HMENU
handle
,
UINT
item_id
,
UINT
flags
)
UINT
get_menu_state
(
HMENU
handle
,
UINT
item_id
,
UINT
flags
)
{
POPUPMENU
*
menu
;
UINT
state
,
pos
;
...
...
dlls/win32u/ntuser_private.h
View file @
9f03d8f3
...
...
@@ -36,6 +36,8 @@ struct user_callbacks
BOOL
(
WINAPI
*
pImmProcessKey
)(
HWND
,
HKL
,
UINT
,
LPARAM
,
DWORD
);
BOOL
(
WINAPI
*
pImmTranslateMessage
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
NTSTATUS
(
WINAPI
*
pNtWaitForMultipleObjects
)(
ULONG
,
const
HANDLE
*
,
BOOLEAN
,
BOOLEAN
,
const
LARGE_INTEGER
*
);
UINT
(
CDECL
*
draw_menu
)(
HDC
hDC
,
LPRECT
lprect
,
HWND
hwnd
);
void
(
CDECL
*
draw_nc_scrollbar
)(
HWND
hwnd
,
HDC
hdc
,
BOOL
draw_horizontal
,
BOOL
draw_vertical
);
void
(
CDECL
*
free_win_ptr
)(
struct
tagWND
*
win
);
HMENU
(
CDECL
*
get_sys_menu
)(
HWND
hwnd
,
HMENU
popup
);
HWND
(
CDECL
*
is_menu_active
)(
void
);
...
...
dlls/win32u/sysparams.c
View file @
9f03d8f3
...
...
@@ -4499,7 +4499,7 @@ static int get_system_metrics_for_dpi( int index, unsigned int dpi )
}
}
static
COLORREF
get_sys_color
(
int
index
)
COLORREF
get_sys_color
(
int
index
)
{
COLORREF
ret
=
0
;
...
...
@@ -4508,7 +4508,7 @@ static COLORREF get_sys_color( int index )
return
ret
;
}
static
HBRUSH
get_55aa_brush
(
void
)
HBRUSH
get_55aa_brush
(
void
)
{
static
const
WORD
pattern
[]
=
{
0x5555
,
0xaaaa
,
0x5555
,
0xaaaa
,
0x5555
,
0xaaaa
,
0x5555
,
0xaaaa
};
static
HBRUSH
brush_55aa
;
...
...
@@ -4546,7 +4546,7 @@ HBRUSH get_sys_color_brush( unsigned int index )
return
system_colors
[
index
].
brush
;
}
static
HPEN
get_sys_color_pen
(
unsigned
int
index
)
HPEN
get_sys_color_pen
(
unsigned
int
index
)
{
if
(
index
>=
ARRAY_SIZE
(
system_colors
))
return
0
;
...
...
dlls/win32u/win32u_private.h
View file @
9f03d8f3
...
...
@@ -394,6 +394,7 @@ extern BOOL draw_menu_bar( HWND hwnd ) DECLSPEC_HIDDEN;
extern
HMENU
get_menu
(
HWND
hwnd
)
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
;
extern
BOOL
set_window_menu
(
HWND
hwnd
,
HMENU
handle
)
DECLSPEC_HIDDEN
;
/* message.c */
...
...
@@ -411,12 +412,15 @@ 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
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
;
extern
UINT
get_win_monitor_dpi
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
RECT
get_primary_monitor_rect
(
UINT
dpi
)
DECLSPEC_HIDDEN
;
extern
COLORREF
get_sys_color
(
int
index
)
DECLSPEC_HIDDEN
;
extern
HBRUSH
get_sys_color_brush
(
unsigned
int
index
)
DECLSPEC_HIDDEN
;
extern
HPEN
get_sys_color_pen
(
unsigned
int
index
)
DECLSPEC_HIDDEN
;
extern
UINT
get_system_dpi
(
void
)
DECLSPEC_HIDDEN
;
extern
int
get_system_metrics
(
int
index
)
DECLSPEC_HIDDEN
;
extern
UINT
get_thread_dpi
(
void
)
DECLSPEC_HIDDEN
;
...
...
include/ntgdi.h
View file @
9f03d8f3
...
...
@@ -115,6 +115,7 @@ enum
NtGdiSetDCPenColor
,
NtGdiSetGraphicsMode
,
NtGdiSetROP2
,
NtGdiSetTextAlign
,
};
/* NtGdiGetDCDword parameter, not compatible with Windows */
...
...
include/ntuser.h
View file @
9f03d8f3
...
...
@@ -33,6 +33,7 @@ enum
NtUserCallWinProc
,
NtUserCallWindowsHook
,
NtUserCopyImage
,
NtUserDrawText
,
NtUserFreeCachedClipboardData
,
NtUserLoadDriver
,
NtUserLoadImage
,
...
...
@@ -158,6 +159,16 @@ struct copy_image_params
UINT
flags
;
};
/* NtUserDrawText params */
struct
draw_text_params
{
HDC
hdc
;
int
count
;
RECT
*
rect
;
/* FIXME: Use NtCallbackReturn instead */
UINT
flags
;
WCHAR
str
[
1
];
};
/* NtUserFreeCachedClipboardData params */
struct
free_cached_data_params
{
...
...
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