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
86f9c8b1
Commit
86f9c8b1
authored
Jun 16, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserGetTitleBarInfo implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
4663446f
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
127 deletions
+86
-127
nonclient.c
dlls/user32/nonclient.c
+0
-125
user32.spec
dlls/user32/user32.spec
+1
-1
defwnd.c
dlls/win32u/defwnd.c
+73
-0
syscall.c
dlls/win32u/syscall.c
+1
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
syscall.h
dlls/wow64win/syscall.h
+1
-0
user.c
dlls/wow64win/user.c
+8
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/nonclient.c
View file @
86f9c8b1
...
...
@@ -33,28 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(nonclient);
#define SC_ABOUTWINE (SC_SCREENSAVE+1)
/* Some useful macros */
#define HAS_DLGFRAME(style,exStyle) \
(((exStyle) & WS_EX_DLGMODALFRAME) || \
(((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME)))
#define HAS_THICKFRAME(style,exStyle) \
(((style) & WS_THICKFRAME) && \
!(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
#define HAS_THINFRAME(style) \
(((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP)))
#define HAS_BIGFRAME(style,exStyle) \
(((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \
((exStyle) & WS_EX_DLGMODALFRAME))
#define HAS_STATICOUTERFRAME(style,exStyle) \
(((exStyle) & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == \
WS_EX_STATICEDGE)
#define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
static
void
adjust_window_rect
(
RECT
*
rect
,
DWORD
style
,
BOOL
menu
,
DWORD
exStyle
,
NONCLIENTMETRICSW
*
ncm
)
{
...
...
@@ -164,42 +142,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectExForDpi( LPRECT rect, DWORD style
}
/***********************************************************************
* NC_GetInsideRect
*
* Get the 'inside' rectangle of a window, i.e. the whole window rectangle
* but without the borders (if any).
*/
static
void
NC_GetInsideRect
(
HWND
hwnd
,
enum
coords_relative
relative
,
RECT
*
rect
,
DWORD
style
,
DWORD
ex_style
)
{
WIN_GetRectangles
(
hwnd
,
relative
,
rect
,
NULL
);
/* Remove frame from rectangle */
if
(
HAS_THICKFRAME
(
style
,
ex_style
))
{
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXFRAME
),
-
GetSystemMetrics
(
SM_CYFRAME
)
);
}
else
if
(
HAS_DLGFRAME
(
style
,
ex_style
))
{
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXDLGFRAME
),
-
GetSystemMetrics
(
SM_CYDLGFRAME
));
}
else
if
(
HAS_THINFRAME
(
style
))
{
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
((
style
&
WS_CHILD
)
&&
!
(
ex_style
&
WS_EX_MDICHILD
))
{
if
(
ex_style
&
WS_EX_CLIENTEDGE
)
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXEDGE
),
-
GetSystemMetrics
(
SM_CYEDGE
));
if
(
ex_style
&
WS_EX_STATICEDGE
)
InflateRect
(
rect
,
-
GetSystemMetrics
(
SM_CXBORDER
),
-
GetSystemMetrics
(
SM_CYBORDER
));
}
}
LRESULT
NC_HandleNCMouseMove
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
RECT
rect
;
...
...
@@ -306,70 +248,3 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
}
return
0
;
}
/***********************************************************************
* GetTitleBarInfo (USER32.@)
* TODO: Handle STATE_SYSTEM_PRESSED
*/
BOOL
WINAPI
GetTitleBarInfo
(
HWND
hwnd
,
PTITLEBARINFO
tbi
)
{
DWORD
dwStyle
;
DWORD
dwExStyle
;
TRACE
(
"(%p %p)
\n
"
,
hwnd
,
tbi
);
if
(
!
tbi
)
{
SetLastError
(
ERROR_NOACCESS
);
return
FALSE
;
}
if
(
tbi
->
cbSize
!=
sizeof
(
TITLEBARINFO
))
{
TRACE
(
"Invalid TITLEBARINFO size: %ld
\n
"
,
tbi
->
cbSize
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
dwExStyle
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
NC_GetInsideRect
(
hwnd
,
COORDS_SCREEN
,
&
tbi
->
rcTitleBar
,
dwStyle
,
dwExStyle
);
tbi
->
rcTitleBar
.
bottom
=
tbi
->
rcTitleBar
.
top
;
if
(
dwExStyle
&
WS_EX_TOOLWINDOW
)
tbi
->
rcTitleBar
.
bottom
+=
GetSystemMetrics
(
SM_CYSMCAPTION
);
else
{
tbi
->
rcTitleBar
.
bottom
+=
GetSystemMetrics
(
SM_CYCAPTION
);
tbi
->
rcTitleBar
.
left
+=
GetSystemMetrics
(
SM_CXSIZE
);
}
ZeroMemory
(
tbi
->
rgstate
,
sizeof
(
tbi
->
rgstate
));
/* Does the title bar always have STATE_SYSTEM_FOCUSABLE?
* Under XP it seems to
*/
tbi
->
rgstate
[
0
]
=
STATE_SYSTEM_FOCUSABLE
;
if
(
dwStyle
&
WS_CAPTION
)
{
tbi
->
rgstate
[
1
]
=
STATE_SYSTEM_INVISIBLE
;
if
(
dwStyle
&
WS_SYSMENU
)
{
if
(
!
(
dwStyle
&
(
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
)))
{
tbi
->
rgstate
[
2
]
=
STATE_SYSTEM_INVISIBLE
;
tbi
->
rgstate
[
3
]
=
STATE_SYSTEM_INVISIBLE
;
}
else
{
if
(
!
(
dwStyle
&
WS_MINIMIZEBOX
))
tbi
->
rgstate
[
2
]
=
STATE_SYSTEM_UNAVAILABLE
;
if
(
!
(
dwStyle
&
WS_MAXIMIZEBOX
))
tbi
->
rgstate
[
3
]
=
STATE_SYSTEM_UNAVAILABLE
;
}
if
(
!
(
dwExStyle
&
WS_EX_CONTEXTHELP
))
tbi
->
rgstate
[
4
]
=
STATE_SYSTEM_INVISIBLE
;
if
(
GetClassLongW
(
hwnd
,
GCL_STYLE
)
&
CS_NOCLOSE
)
tbi
->
rgstate
[
5
]
=
STATE_SYSTEM_UNAVAILABLE
;
}
else
{
tbi
->
rgstate
[
2
]
=
STATE_SYSTEM_INVISIBLE
;
tbi
->
rgstate
[
3
]
=
STATE_SYSTEM_INVISIBLE
;
tbi
->
rgstate
[
4
]
=
STATE_SYSTEM_INVISIBLE
;
tbi
->
rgstate
[
5
]
=
STATE_SYSTEM_INVISIBLE
;
}
}
else
tbi
->
rgstate
[
0
]
|=
STATE_SYSTEM_INVISIBLE
;
return
TRUE
;
}
dlls/user32/user32.spec
View file @
86f9c8b1
...
...
@@ -389,7 +389,7 @@
@ stdcall GetTaskmanWindow ()
@ stdcall GetThreadDesktop(long) NtUserGetThreadDesktop
@ stdcall GetThreadDpiAwarenessContext()
@ stdcall GetTitleBarInfo(long ptr)
@ stdcall GetTitleBarInfo(long ptr)
NtUserGetTitleBarInfo
@ stdcall GetTopWindow(long)
@ stdcall GetTouchInputInfo(long long ptr long)
@ stdcall GetUpdateRect(long ptr long) NtUserGetUpdateRect
...
...
dlls/win32u/defwnd.c
View file @
86f9c8b1
...
...
@@ -2514,3 +2514,76 @@ LRESULT desktop_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
return
default_window_proc
(
hwnd
,
msg
,
wparam
,
lparam
,
FALSE
);
}
/***********************************************************************
* NtUserGetTitleBarInfo (win32u.@)
*/
BOOL
WINAPI
NtUserGetTitleBarInfo
(
HWND
hwnd
,
TITLEBARINFO
*
info
)
{
DWORD
style
,
ex_style
;
TRACE
(
"(%p %p)
\n
"
,
hwnd
,
info
);
if
(
!
info
)
{
SetLastError
(
ERROR_NOACCESS
);
return
FALSE
;
}
if
(
info
->
cbSize
!=
sizeof
(
TITLEBARINFO
))
{
TRACE
(
"Invalid TITLEBARINFO size: %d
\n
"
,
info
->
cbSize
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
style
=
get_window_long
(
hwnd
,
GWL_STYLE
);
ex_style
=
get_window_long
(
hwnd
,
GWL_EXSTYLE
);
get_inside_rect
(
hwnd
,
COORDS_SCREEN
,
&
info
->
rcTitleBar
,
style
,
ex_style
);
info
->
rcTitleBar
.
bottom
=
info
->
rcTitleBar
.
top
;
if
(
ex_style
&
WS_EX_TOOLWINDOW
)
info
->
rcTitleBar
.
bottom
+=
get_system_metrics
(
SM_CYSMCAPTION
);
else
{
info
->
rcTitleBar
.
bottom
+=
get_system_metrics
(
SM_CYCAPTION
);
info
->
rcTitleBar
.
left
+=
get_system_metrics
(
SM_CXSIZE
);
}
memset
(
info
->
rgstate
,
0
,
sizeof
(
info
->
rgstate
)
);
info
->
rgstate
[
0
]
=
STATE_SYSTEM_FOCUSABLE
;
if
(
style
&
WS_CAPTION
)
{
info
->
rgstate
[
1
]
=
STATE_SYSTEM_INVISIBLE
;
if
(
style
&
WS_SYSMENU
)
{
if
(
!
(
style
&
(
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
)))
{
info
->
rgstate
[
2
]
=
STATE_SYSTEM_INVISIBLE
;
info
->
rgstate
[
3
]
=
STATE_SYSTEM_INVISIBLE
;
}
else
{
if
(
!
(
style
&
WS_MINIMIZEBOX
))
info
->
rgstate
[
2
]
=
STATE_SYSTEM_UNAVAILABLE
;
if
(
!
(
style
&
WS_MAXIMIZEBOX
))
info
->
rgstate
[
3
]
=
STATE_SYSTEM_UNAVAILABLE
;
}
if
(
!
(
ex_style
&
WS_EX_CONTEXTHELP
))
info
->
rgstate
[
4
]
=
STATE_SYSTEM_INVISIBLE
;
if
(
get_class_long
(
hwnd
,
GCL_STYLE
,
FALSE
)
&
CS_NOCLOSE
)
info
->
rgstate
[
5
]
=
STATE_SYSTEM_UNAVAILABLE
;
}
else
{
info
->
rgstate
[
2
]
=
STATE_SYSTEM_INVISIBLE
;
info
->
rgstate
[
3
]
=
STATE_SYSTEM_INVISIBLE
;
info
->
rgstate
[
4
]
=
STATE_SYSTEM_INVISIBLE
;
info
->
rgstate
[
5
]
=
STATE_SYSTEM_INVISIBLE
;
}
}
else
info
->
rgstate
[
0
]
|=
STATE_SYSTEM_INVISIBLE
;
return
TRUE
;
}
dlls/win32u/syscall.c
View file @
86f9c8b1
...
...
@@ -147,6 +147,7 @@ static void * const syscalls[] =
NtUserGetProp
,
NtUserGetSystemDpiForProcess
,
NtUserGetThreadDesktop
,
NtUserGetTitleBarInfo
,
NtUserGetWindowRgnEx
,
NtUserInitializeClientPfnArrays
,
NtUserInternalGetWindowText
,
...
...
dlls/win32u/win32u.spec
View file @
86f9c8b1
...
...
@@ -997,7 +997,7 @@
@ stdcall NtUserGetSystemMenu(long long)
@ stdcall -syscall NtUserGetThreadDesktop(long)
@ stub NtUserGetThreadState
@ st
ub NtUserGetTitleBarInfo
@ st
dcall -syscall NtUserGetTitleBarInfo(long ptr)
@ stub NtUserGetTopLevelWindow
@ stub NtUserGetTouchInputInfo
@ stub NtUserGetTouchValidationStatus
...
...
dlls/wow64win/syscall.h
View file @
86f9c8b1
...
...
@@ -134,6 +134,7 @@
SYSCALL_ENTRY( NtUserGetProp ) \
SYSCALL_ENTRY( NtUserGetSystemDpiForProcess ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
SYSCALL_ENTRY( NtUserGetTitleBarInfo ) \
SYSCALL_ENTRY( NtUserGetWindowRgnEx ) \
SYSCALL_ENTRY( NtUserInitializeClientPfnArrays ) \
SYSCALL_ENTRY( NtUserInternalGetWindowText ) \
...
...
dlls/wow64win/user.c
View file @
86f9c8b1
...
...
@@ -850,3 +850,11 @@ NTSTATUS WINAPI wow64_NtUserLockWindowUpdate( UINT *args )
return
NtUserLockWindowUpdate
(
hwnd
);
}
NTSTATUS
WINAPI
wow64_NtUserGetTitleBarInfo
(
UINT
*
args
)
{
HWND
hwnd
=
get_handle
(
&
args
);
TITLEBARINFO
*
info
=
get_ptr
(
&
args
);
return
NtUserGetTitleBarInfo
(
hwnd
,
info
);
}
include/ntuser.h
View file @
86f9c8b1
...
...
@@ -609,6 +609,7 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags );
ULONG
WINAPI
NtUserGetSystemDpiForProcess
(
HANDLE
process
);
HMENU
WINAPI
NtUserGetSystemMenu
(
HWND
hwnd
,
BOOL
revert
);
HDESK
WINAPI
NtUserGetThreadDesktop
(
DWORD
thread
);
BOOL
WINAPI
NtUserGetTitleBarInfo
(
HWND
hwnd
,
TITLEBARINFO
*
info
);
INT
WINAPI
NtUserGetUpdateRgn
(
HWND
hwnd
,
HRGN
hrgn
,
BOOL
erase
);
BOOL
WINAPI
NtUserGetUpdatedClipboardFormats
(
UINT
*
formats
,
UINT
size
,
UINT
*
out_size
);
BOOL
WINAPI
NtUserGetUpdateRect
(
HWND
hwnd
,
RECT
*
rect
,
BOOL
erase
);
...
...
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