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
bdae778e
Commit
bdae778e
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 WM_SETCURSOR implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
67e39efb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
68 deletions
+64
-68
controls.h
dlls/user32/controls.h
+0
-1
defwnd.c
dlls/user32/defwnd.c
+0
-15
nonclient.c
dlls/user32/nonclient.c
+0
-52
defwnd.c
dlls/win32u/defwnd.c
+64
-0
No files found.
dlls/user32/controls.h
View file @
bdae778e
...
...
@@ -123,7 +123,6 @@ extern LRESULT NC_HandleNCMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam ) D
extern
LRESULT
NC_HandleNCMouseLeave
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleNCLButtonDblClk
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
extern
LRESULT
NC_HandleSetCursor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
DECLSPEC_HIDDEN
;
/* scrollbar */
...
...
dlls/user32/defwnd.c
View file @
bdae778e
...
...
@@ -225,21 +225,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case
WM_CTLCOLOR
:
return
(
LRESULT
)
DEFWND_ControlColor
(
(
HDC
)
wParam
,
HIWORD
(
lParam
)
);
case
WM_SETCURSOR
:
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
{
/* with the exception of the border around a resizable wnd,
* give the parent first chance to set the cursor */
if
((
LOWORD
(
lParam
)
<
HTSIZEFIRST
)
||
(
LOWORD
(
lParam
)
>
HTSIZELAST
))
{
HWND
parent
=
GetParent
(
hwnd
);
if
(
parent
!=
GetDesktopWindow
()
&&
SendMessageW
(
parent
,
WM_SETCURSOR
,
wParam
,
lParam
))
return
TRUE
;
}
}
NC_HandleSetCursor
(
hwnd
,
wParam
,
lParam
);
break
;
case
WM_SYSCOMMAND
:
return
NC_HandleSysCommand
(
hwnd
,
wParam
,
lParam
);
...
...
dlls/user32/nonclient.c
View file @
bdae778e
...
...
@@ -236,58 +236,6 @@ LRESULT NC_HandleNCMouseLeave(HWND hwnd)
return
0
;
}
/***********************************************************************
* NC_HandleSetCursor
*
* Handle a WM_SETCURSOR message. Called from DefWindowProc().
*/
LRESULT
NC_HandleSetCursor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
hwnd
=
WIN_GetFullHandle
(
(
HWND
)
wParam
);
switch
((
short
)
LOWORD
(
lParam
))
{
case
HTERROR
:
{
WORD
msg
=
HIWORD
(
lParam
);
if
((
msg
==
WM_LBUTTONDOWN
)
||
(
msg
==
WM_MBUTTONDOWN
)
||
(
msg
==
WM_RBUTTONDOWN
)
||
(
msg
==
WM_XBUTTONDOWN
))
MessageBeep
(
0
);
}
break
;
case
HTCLIENT
:
{
HCURSOR
hCursor
=
(
HCURSOR
)
GetClassLongPtrW
(
hwnd
,
GCLP_HCURSOR
);
if
(
hCursor
)
{
NtUserSetCursor
(
hCursor
);
return
TRUE
;
}
return
FALSE
;
}
case
HTLEFT
:
case
HTRIGHT
:
return
(
LRESULT
)
NtUserSetCursor
(
LoadCursorA
(
0
,
(
LPSTR
)
IDC_SIZEWE
)
);
case
HTTOP
:
case
HTBOTTOM
:
return
(
LRESULT
)
NtUserSetCursor
(
LoadCursorA
(
0
,
(
LPSTR
)
IDC_SIZENS
)
);
case
HTTOPLEFT
:
case
HTBOTTOMRIGHT
:
return
(
LRESULT
)
NtUserSetCursor
(
LoadCursorA
(
0
,
(
LPSTR
)
IDC_SIZENWSE
)
);
case
HTTOPRIGHT
:
case
HTBOTTOMLEFT
:
return
(
LRESULT
)
NtUserSetCursor
(
LoadCursorA
(
0
,
(
LPSTR
)
IDC_SIZENESW
)
);
}
/* Default cursor: arrow */
return
(
LRESULT
)
NtUserSetCursor
(
LoadCursorA
(
0
,
(
LPSTR
)
IDC_ARROW
)
);
}
/***********************************************************************
* NC_TrackScrollBar
...
...
dlls/win32u/defwnd.c
View file @
bdae778e
...
...
@@ -414,6 +414,55 @@ static HICON set_window_icon( HWND hwnd, WPARAM type, HICON icon )
return
ret
;
}
static
LRESULT
handle_set_cursor
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
UINT
cursor_id
=
IDC_ARROW
;
HCURSOR
cursor
;
hwnd
=
get_full_window_handle
(
(
HWND
)
wparam
);
switch
((
short
)
LOWORD
(
lparam
))
{
case
HTERROR
:
{
WORD
msg
=
HIWORD
(
lparam
);
if
(
msg
==
WM_LBUTTONDOWN
||
msg
==
WM_MBUTTONDOWN
||
msg
==
WM_RBUTTONDOWN
||
msg
==
WM_XBUTTONDOWN
)
message_beep
(
0
);
}
break
;
case
HTCLIENT
:
cursor
=
(
HCURSOR
)
get_class_long_ptr
(
hwnd
,
GCLP_HCURSOR
,
FALSE
);
if
(
!
cursor
)
return
FALSE
;
NtUserSetCursor
(
cursor
);
return
TRUE
;
case
HTLEFT
:
case
HTRIGHT
:
cursor_id
=
IDC_SIZEWE
;
break
;
case
HTTOP
:
case
HTBOTTOM
:
cursor_id
=
IDC_SIZENS
;
break
;
case
HTTOPLEFT
:
case
HTBOTTOMRIGHT
:
cursor_id
=
IDC_SIZENWSE
;
break
;
case
HTTOPRIGHT
:
case
HTBOTTOMLEFT
:
cursor_id
=
IDC_SIZENESW
;
}
cursor
=
LoadImageW
(
0
,
MAKEINTRESOURCEW
(
cursor_id
),
IMAGE_CURSOR
,
0
,
0
,
LR_SHARED
|
LR_DEFAULTSIZE
);
return
(
LRESULT
)
NtUserSetCursor
(
cursor
);
}
static
LONG
handle_window_pos_changing
(
HWND
hwnd
,
WINDOWPOS
*
winpos
)
{
LONG
style
=
get_window_long
(
hwnd
,
GWL_STYLE
);
...
...
@@ -2307,6 +2356,21 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
result
=
(
LRESULT
)
get_window_icon
(
hwnd
,
wparam
);
break
;
case
WM_SETCURSOR
:
if
(
get_window_long
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
{
/* with the exception of the border around a resizable window,
* give the parent first chance to set the cursor */
if
((
LOWORD
(
lparam
)
<
HTSIZEFIRST
)
||
(
LOWORD
(
lparam
)
>
HTSIZELAST
))
{
HWND
parent
=
get_parent
(
hwnd
);
if
(
parent
!=
get_desktop_window
()
&&
send_message
(
parent
,
WM_SETCURSOR
,
wparam
,
lparam
))
return
TRUE
;
}
}
handle_set_cursor
(
hwnd
,
wparam
,
lparam
);
break
;
case
WM_SYSCOMMAND
:
result
=
handle_sys_command
(
hwnd
,
wparam
,
lparam
);
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