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
a8ed1c94
Commit
a8ed1c94
authored
Jun 08, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserDragDetect implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
540dc761
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
41 deletions
+57
-41
win.c
dlls/user32/win.c
+2
-40
gdiobj.c
dlls/win32u/gdiobj.c
+1
-0
input.c
dlls/win32u/input.c
+45
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
win32u_private.h
dlls/win32u/win32u_private.h
+1
-0
wrappers.c
dlls/win32u/wrappers.c
+6
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/win.c
View file @
a8ed1c94
...
...
@@ -1482,47 +1482,9 @@ BOOL WINAPI SetWindowContextHelpId( HWND hwnd, DWORD id )
/*******************************************************************
* DragDetect (USER32.@)
*/
BOOL
WINAPI
DragDetect
(
HWND
h
W
nd
,
POINT
pt
)
BOOL
WINAPI
DragDetect
(
HWND
h
w
nd
,
POINT
pt
)
{
MSG
msg
;
RECT
rect
;
WORD
wDragWidth
,
wDragHeight
;
TRACE
(
"%p,%s
\n
"
,
hWnd
,
wine_dbgstr_point
(
&
pt
)
);
if
(
!
(
NtUserGetKeyState
(
VK_LBUTTON
)
&
0x8000
))
return
FALSE
;
wDragWidth
=
GetSystemMetrics
(
SM_CXDRAG
);
wDragHeight
=
GetSystemMetrics
(
SM_CYDRAG
);
SetRect
(
&
rect
,
pt
.
x
-
wDragWidth
,
pt
.
y
-
wDragHeight
,
pt
.
x
+
wDragWidth
,
pt
.
y
+
wDragHeight
);
NtUserSetCapture
(
hWnd
);
while
(
1
)
{
while
(
PeekMessageW
(
&
msg
,
0
,
WM_MOUSEFIRST
,
WM_MOUSELAST
,
PM_REMOVE
))
{
if
(
msg
.
message
==
WM_LBUTTONUP
)
{
ReleaseCapture
();
return
FALSE
;
}
if
(
msg
.
message
==
WM_MOUSEMOVE
)
{
POINT
tmp
;
tmp
.
x
=
(
short
)
LOWORD
(
msg
.
lParam
);
tmp
.
y
=
(
short
)
HIWORD
(
msg
.
lParam
);
if
(
!
PtInRect
(
&
rect
,
tmp
))
{
ReleaseCapture
();
return
TRUE
;
}
}
}
WaitMessage
();
}
return
FALSE
;
return
NtUserDragDetect
(
hwnd
,
pt
.
x
,
pt
.
y
);
}
/******************************************************************************
...
...
dlls/win32u/gdiobj.c
View file @
a8ed1c94
...
...
@@ -1158,6 +1158,7 @@ static struct unix_funcs unix_funcs =
NtUserDestroyMenu
,
NtUserDestroyWindow
,
NtUserDispatchMessage
,
NtUserDragDetect
,
NtUserDrawIconEx
,
NtUserEmptyClipboard
,
NtUserEnableMenuItem
,
...
...
dlls/win32u/input.c
View file @
a8ed1c94
...
...
@@ -1394,6 +1394,51 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info )
return
TRUE
;
}
/*******************************************************************
* NtUserDragDetect (win32u.@)
*/
BOOL
WINAPI
NtUserDragDetect
(
HWND
hwnd
,
int
x
,
int
y
)
{
WORD
width
,
height
;
RECT
rect
;
MSG
msg
;
TRACE
(
"%p (%d,%d)
\n
"
,
hwnd
,
x
,
y
);
if
(
!
(
NtUserGetKeyState
(
VK_LBUTTON
)
&
0x8000
))
return
FALSE
;
width
=
get_system_metrics
(
SM_CXDRAG
);
height
=
get_system_metrics
(
SM_CYDRAG
);
SetRect
(
&
rect
,
x
-
width
,
y
-
height
,
x
+
width
,
y
+
height
);
NtUserSetCapture
(
hwnd
);
for
(;;)
{
while
(
NtUserPeekMessage
(
&
msg
,
0
,
WM_MOUSEFIRST
,
WM_MOUSELAST
,
PM_REMOVE
))
{
if
(
msg
.
message
==
WM_LBUTTONUP
)
{
release_capture
();
return
FALSE
;
}
if
(
msg
.
message
==
WM_MOUSEMOVE
)
{
POINT
tmp
;
tmp
.
x
=
(
short
)
LOWORD
(
msg
.
lParam
);
tmp
.
y
=
(
short
)
HIWORD
(
msg
.
lParam
);
if
(
!
PtInRect
(
&
rect
,
tmp
))
{
release_capture
();
return
TRUE
;
}
}
}
NtUserMsgWaitForMultipleObjectsEx
(
0
,
NULL
,
INFINITE
,
QS_ALLINPUT
,
0
);
}
return
FALSE
;
}
/**********************************************************************
* set_capture_window
*/
...
...
dlls/win32u/win32u.spec
View file @
a8ed1c94
...
...
@@ -845,7 +845,7 @@
@ stub NtUserDoSoundConnect
@ stub NtUserDoSoundDisconnect
@ stub NtUserDownlevelTouchpad
@ st
ub NtUserDragDetect
@ st
dcall NtUserDragDetect(long long long)
@ stub NtUserDragObject
@ stub NtUserDrawAnimatedRects
@ stub NtUserDrawCaption
...
...
dlls/win32u/win32u_private.h
View file @
a8ed1c94
...
...
@@ -214,6 +214,7 @@ struct unix_funcs
BOOL
(
WINAPI
*
pNtUserDestroyMenu
)(
HMENU
handle
);
BOOL
(
WINAPI
*
pNtUserDestroyWindow
)(
HWND
hwnd
);
LRESULT
(
WINAPI
*
pNtUserDispatchMessage
)(
const
MSG
*
msg
);
BOOL
(
WINAPI
*
pNtUserDragDetect
)(
HWND
hwnd
,
int
x
,
int
y
);
BOOL
(
WINAPI
*
pNtUserDrawIconEx
)(
HDC
hdc
,
INT
x0
,
INT
y0
,
HICON
icon
,
INT
width
,
INT
height
,
UINT
istep
,
HBRUSH
hbr
,
UINT
flags
);
BOOL
(
WINAPI
*
pNtUserEmptyClipboard
)(
void
);
...
...
dlls/win32u/wrappers.c
View file @
a8ed1c94
...
...
@@ -855,6 +855,12 @@ LRESULT WINAPI NtUserDispatchMessage( const MSG *msg )
return
unix_funcs
->
pNtUserDispatchMessage
(
msg
);
}
BOOL
WINAPI
NtUserDragDetect
(
HWND
hwnd
,
int
x
,
int
y
)
{
if
(
!
unix_funcs
)
return
FALSE
;
return
unix_funcs
->
pNtUserDragDetect
(
hwnd
,
x
,
y
);
}
BOOL
WINAPI
NtUserDrawIconEx
(
HDC
hdc
,
INT
x0
,
INT
y0
,
HICON
icon
,
INT
width
,
INT
height
,
UINT
istep
,
HBRUSH
hbr
,
UINT
flags
)
{
...
...
include/ntuser.h
View file @
a8ed1c94
...
...
@@ -513,6 +513,7 @@ BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg );
BOOL
WINAPI
NtUserDestroyMenu
(
HMENU
menu
);
BOOL
WINAPI
NtUserDestroyWindow
(
HWND
hwnd
);
LRESULT
WINAPI
NtUserDispatchMessage
(
const
MSG
*
msg
);
BOOL
WINAPI
NtUserDragDetect
(
HWND
hwnd
,
int
x
,
int
y
);
BOOL
WINAPI
NtUserDrawIconEx
(
HDC
hdc
,
INT
x0
,
INT
y0
,
HICON
icon
,
INT
width
,
INT
height
,
UINT
istep
,
HBRUSH
hbr
,
UINT
flags
);
BOOL
WINAPI
NtUserEmptyClipboard
(
void
);
...
...
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