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
8ddf64b6
Commit
8ddf64b6
authored
Jun 15, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move WM_NCLBUTTONDOWN implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
80ef8832
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
175 additions
and
17 deletions
+175
-17
controls.h
dlls/user32/controls.h
+0
-1
defwnd.c
dlls/user32/defwnd.c
+0
-3
focus.c
dlls/user32/focus.c
+0
-11
nonclient.c
dlls/user32/nonclient.c
+0
-0
user_private.h
dlls/user32/user_private.h
+0
-1
defwnd.c
dlls/win32u/defwnd.c
+175
-1
No files found.
dlls/user32/controls.h
View file @
8ddf64b6
...
...
@@ -121,7 +121,6 @@ extern HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu ) DECLSPEC_HIDDEN;
/* nonclient area */
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
;
extern
LRESULT
NC_HandleNCMouseLeave
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCRButtonDown
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/defwnd.c
View file @
8ddf64b6
...
...
@@ -175,9 +175,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
iF10Key
=
iMenuSysKey
=
0
;
break
;
case
WM_NCLBUTTONDOWN
:
return
NC_HandleNCLButtonDown
(
hwnd
,
wParam
,
lParam
);
case
WM_LBUTTONDBLCLK
:
return
NC_HandleNCLButtonDblClk
(
hwnd
,
HTCLIENT
,
lParam
);
...
...
dlls/user32/focus.c
View file @
8ddf64b6
...
...
@@ -33,17 +33,6 @@
/*******************************************************************
* FOCUS_MouseActivate
*
* Activate a window as a result of a mouse click
*/
BOOL
FOCUS_MouseActivate
(
HWND
hwnd
)
{
return
NtUserSetForegroundWindow
(
hwnd
,
TRUE
);
}
/*******************************************************************
* SetForegroundWindow (USER32.@)
*/
BOOL
WINAPI
SetForegroundWindow
(
HWND
hwnd
)
...
...
dlls/user32/nonclient.c
View file @
8ddf64b6
This diff is collapsed.
Click to expand it.
dlls/user32/user_private.h
View file @
8ddf64b6
...
...
@@ -86,7 +86,6 @@ extern void free_cached_data( UINT format, HANDLE handle ) DECLSPEC_HIDDEN;
extern
HANDLE
render_synthesized_format
(
UINT
format
,
UINT
from
)
DECLSPEC_HIDDEN
;
extern
void
CLIPBOARD_ReleaseOwner
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
FOCUS_MouseActivate
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
set_capture_window
(
HWND
hwnd
,
UINT
gui_flags
,
HWND
*
prev_ret
)
DECLSPEC_HIDDEN
;
extern
HDC
get_display_dc
(
void
)
DECLSPEC_HIDDEN
;
extern
void
release_display_dc
(
HDC
hdc
)
DECLSPEC_HIDDEN
;
...
...
dlls/win32u/defwnd.c
View file @
8ddf64b6
...
...
@@ -1790,6 +1790,177 @@ static LRESULT handle_nc_hit_test( HWND hwnd, POINT pt )
return
HTNOWHERE
;
}
static
void
track_min_max_box
(
HWND
hwnd
,
WORD
wparam
)
{
HDC
hdc
=
NtUserGetDCEx
(
hwnd
,
0
,
DCX_USESTYLE
|
DCX_WINDOW
);
DWORD
style
=
get_window_long
(
hwnd
,
GWL_STYLE
);
HMENU
sys_menu
=
NtUserGetSystemMenu
(
hwnd
,
FALSE
);
void
(
*
paint_button
)(
HWND
,
HDC
,
BOOL
,
BOOL
);
BOOL
pressed
=
TRUE
;
UINT
state
;
MSG
msg
;
if
(
wparam
==
HTMINBUTTON
)
{
/* If the style is not present, do nothing */
if
(
!
(
style
&
WS_MINIMIZEBOX
))
return
;
/* Check if the sysmenu item for minimize is there */
state
=
get_menu_state
(
sys_menu
,
SC_MINIMIZE
,
MF_BYCOMMAND
);
paint_button
=
draw_min_button
;
}
else
{
/* If the style is not present, do nothing */
if
(
!
(
style
&
WS_MAXIMIZEBOX
))
return
;
/* Check if the sysmenu item for maximize is there */
state
=
get_menu_state
(
sys_menu
,
SC_MAXIMIZE
,
MF_BYCOMMAND
);
paint_button
=
draw_max_button
;
}
NtUserSetCapture
(
hwnd
);
paint_button
(
hwnd
,
hdc
,
TRUE
,
FALSE
);
for
(;;)
{
BOOL
oldstate
=
pressed
;
if
(
!
NtUserGetMessage
(
&
msg
,
0
,
WM_MOUSEFIRST
,
WM_MOUSELAST
))
break
;
if
(
NtUserCallMsgFilter
(
&
msg
,
MSGF_MAX
))
continue
;
if
(
msg
.
message
==
WM_LBUTTONUP
)
break
;
if
(
msg
.
message
!=
WM_MOUSEMOVE
)
continue
;
pressed
=
handle_nc_hit_test
(
hwnd
,
msg
.
pt
)
==
wparam
;
if
(
pressed
!=
oldstate
)
paint_button
(
hwnd
,
hdc
,
pressed
,
FALSE
);
}
if
(
pressed
)
paint_button
(
hwnd
,
hdc
,
FALSE
,
FALSE
);
release_capture
();
NtUserReleaseDC
(
hwnd
,
hdc
);
/* If the minimize or maximize items of the sysmenu are not there
* or if the style is not present, do nothing */
if
(
!
pressed
||
state
==
0xffffffff
)
return
;
if
(
wparam
==
HTMINBUTTON
)
send_message
(
hwnd
,
WM_SYSCOMMAND
,
is_iconic
(
hwnd
)
?
SC_RESTORE
:
SC_MINIMIZE
,
MAKELONG
(
msg
.
pt
.
x
,
msg
.
pt
.
y
));
else
send_message
(
hwnd
,
WM_SYSCOMMAND
,
is_zoomed
(
hwnd
)
?
SC_RESTORE
:
SC_MAXIMIZE
,
MAKELONG
(
msg
.
pt
.
x
,
msg
.
pt
.
y
));
}
static
void
track_close_button
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
HMENU
sys_menu
;
BOOL
pressed
=
TRUE
;
UINT
state
;
MSG
msg
;
HDC
hdc
;
if
(
!
(
sys_menu
=
NtUserGetSystemMenu
(
hwnd
,
FALSE
)))
return
;
state
=
get_menu_state
(
sys_menu
,
SC_CLOSE
,
MF_BYCOMMAND
);
/* If the close item of the sysmenu is disabled or not present do nothing */
if
((
state
&
MF_DISABLED
)
||
(
state
&
MF_GRAYED
)
||
state
==
0xFFFFFFFF
)
return
;
hdc
=
NtUserGetDCEx
(
hwnd
,
0
,
DCX_USESTYLE
|
DCX_WINDOW
);
NtUserSetCapture
(
hwnd
);
draw_close_button
(
hwnd
,
hdc
,
TRUE
,
FALSE
);
for
(;;)
{
BOOL
oldstate
=
pressed
;
if
(
!
NtUserGetMessage
(
&
msg
,
0
,
WM_MOUSEFIRST
,
WM_MOUSELAST
))
break
;
if
(
NtUserCallMsgFilter
(
&
msg
,
MSGF_MAX
))
continue
;
if
(
msg
.
message
==
WM_LBUTTONUP
)
break
;
if
(
msg
.
message
!=
WM_MOUSEMOVE
)
continue
;
pressed
=
handle_nc_hit_test
(
hwnd
,
msg
.
pt
)
==
wparam
;
if
(
pressed
!=
oldstate
)
draw_close_button
(
hwnd
,
hdc
,
pressed
,
FALSE
);
}
if
(
pressed
)
draw_close_button
(
hwnd
,
hdc
,
FALSE
,
FALSE
);
release_capture
();
NtUserReleaseDC
(
hwnd
,
hdc
);
if
(
pressed
)
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
lparam
);
}
static
LRESULT
handle_nc_lbutton_down
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
LONG
style
=
get_window_long
(
hwnd
,
GWL_STYLE
);
switch
(
wparam
)
/* Hit test */
{
case
HTCAPTION
:
{
HWND
top
=
hwnd
,
parent
;
for
(;;)
{
if
((
get_window_long
(
top
,
GWL_STYLE
)
&
(
WS_POPUP
|
WS_CHILD
))
!=
WS_CHILD
)
break
;
parent
=
NtUserGetAncestor
(
top
,
GA_PARENT
);
if
(
!
parent
||
parent
==
get_desktop_window
())
break
;
top
=
parent
;
}
if
(
set_foreground_window
(
top
,
TRUE
)
||
(
get_active_window
()
==
top
))
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_MOVE
+
HTCAPTION
,
lparam
);
break
;
}
case
HTSYSMENU
:
if
(
style
&
WS_SYSMENU
)
{
HDC
hdc
=
NtUserGetDCEx
(
hwnd
,
0
,
DCX_USESTYLE
|
DCX_WINDOW
);
draw_nc_sys_button
(
hwnd
,
hdc
,
TRUE
);
NtUserReleaseDC
(
hwnd
,
hdc
);
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_MOUSEMENU
+
HTSYSMENU
,
lparam
);
}
break
;
case
HTMENU
:
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_MOUSEMENU
,
lparam
);
break
;
case
HTHSCROLL
:
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_HSCROLL
+
HTHSCROLL
,
lparam
);
break
;
case
HTVSCROLL
:
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_VSCROLL
+
HTVSCROLL
,
lparam
);
break
;
case
HTMINBUTTON
:
case
HTMAXBUTTON
:
track_min_max_box
(
hwnd
,
wparam
);
break
;
case
HTCLOSE
:
track_close_button
(
hwnd
,
wparam
,
lparam
);
break
;
case
HTLEFT
:
case
HTRIGHT
:
case
HTTOP
:
case
HTTOPLEFT
:
case
HTTOPRIGHT
:
case
HTBOTTOM
:
case
HTBOTTOMLEFT
:
case
HTBOTTOMRIGHT
:
send_message
(
hwnd
,
WM_SYSCOMMAND
,
SC_SIZE
+
wparam
-
(
HTLEFT
-
WMSZ_LEFT
),
lparam
);
break
;
case
HTBORDER
:
break
;
}
return
0
;
}
LRESULT
default_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
)
{
LRESULT
result
=
0
;
...
...
@@ -1835,6 +2006,9 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
case
WM_NCACTIVATE
:
return
handle_nc_activate
(
hwnd
,
wparam
,
lparam
);
case
WM_NCLBUTTONDOWN
:
return
handle_nc_lbutton_down
(
hwnd
,
wparam
,
lparam
);
case
WM_WINDOWPOSCHANGING
:
return
handle_window_pos_changing
(
hwnd
,
(
WINDOWPOS
*
)
lparam
);
...
...
@@ -1886,7 +2060,7 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
if
(
result
)
break
;
}
/* Caption clicks are handled by
NC_HandleNCLButtonD
own() */
/* Caption clicks are handled by
handle_nc_lbutton_d
own() */
result
=
HIWORD
(
lparam
)
==
WM_LBUTTONDOWN
&&
LOWORD
(
lparam
)
==
HTCAPTION
?
MA_NOACTIVATE
:
MA_ACTIVATE
;
break
;
...
...
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