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
1c73fcdb
Commit
1c73fcdb
authored
Aug 26, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix DefWindowProc behavior on WM_NCRBUTTONDOWN message.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ae7398e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
4 deletions
+41
-4
nonclient.c
dlls/user32/nonclient.c
+1
-3
msg.c
dlls/user32/tests/msg.c
+40
-1
No files found.
dlls/user32/nonclient.c
View file @
1c73fcdb
...
...
@@ -1487,8 +1487,6 @@ LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
{
case
HTCAPTION
:
case
HTSYSMENU
:
if
(
!
GetSystemMenu
(
hwnd
,
FALSE
))
break
;
SetCapture
(
hwnd
);
for
(;;)
{
...
...
@@ -1502,7 +1500,7 @@ LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
}
ReleaseCapture
();
if
(
hittest
==
HTCAPTION
||
hittest
==
HTSYSMENU
)
SendMessageW
(
hwnd
,
WM_
SYSCOMMAND
,
SC_MOUSEMENU
+
HTSYSMENU
,
msg
.
lParam
);
SendMessageW
(
hwnd
,
WM_
CONTEXTMENU
,
(
WPARAM
)
hwnd
,
MAKELPARAM
(
msg
.
pt
.
x
,
msg
.
pt
.
y
)
);
break
;
}
return
0
;
...
...
dlls/user32/tests/msg.c
View file @
1c73fcdb
...
...
@@ -8199,6 +8199,12 @@ static LRESULT MsgCheckProc (BOOL unicode, HWND hwnd, UINT message,
return
0
;
}
if
(
message
==
WM_CONTEXTMENU
)
{
/* don't create context menu */
return
0
;
}
defwndproc_counter
++
;
ret
=
unicode
?
DefWindowProcW
(
hwnd
,
message
,
wParam
,
lParam
)
:
DefWindowProcA
(
hwnd
,
message
,
wParam
,
lParam
);
...
...
@@ -13887,13 +13893,46 @@ static void test_paintingloop(void)
DestroyWindow
(
hwnd
);
}
static
const
struct
message
NCRBUTTONDOWNSeq
[]
=
{
{
EVENT_SYSTEM_CAPTURESTART
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
EVENT_SYSTEM_CAPTUREEND
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_CAPTURECHANGED
,
sent
},
{
WM_CONTEXTMENU
,
sent
,
/*hwnd*/
0
,
-
1
},
{
0
}
};
static
void
test_defwinproc
(
void
)
{
HWND
hwnd
;
MSG
msg
;
BOOL
gotwmquit
=
FALSE
;
hwnd
=
CreateWindowExA
(
0
,
"static"
,
"test_defwndproc"
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
POINT
pos
;
RECT
rect
;
INT
x
,
y
;
LRESULT
res
;
hwnd
=
CreateWindowExA
(
0
,
"TestWindowClass"
,
"test_defwndproc"
,
WS_VISIBLE
|
WS_CAPTION
|
WS_OVERLAPPEDWINDOW
,
0
,
0
,
500
,
100
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
);
flush_events
();
GetCursorPos
(
&
pos
);
GetWindowRect
(
hwnd
,
&
rect
);
x
=
(
rect
.
left
+
rect
.
right
)
/
2
;
y
=
rect
.
top
+
GetSystemMetrics
(
SM_CYFRAME
)
+
1
;
SetCursorPos
(
x
,
y
);
flush_events
();
res
=
DefWindowProcA
(
hwnd
,
WM_NCHITTEST
,
0
,
MAKELPARAM
(
x
,
y
));
ok
(
res
==
HTCAPTION
,
"WM_NCHITTEST returned %ld
\n
"
,
res
);
flush_sequence
();
PostMessageA
(
hwnd
,
WM_RBUTTONUP
,
0
,
0
);
DefWindowProcA
(
hwnd
,
WM_NCRBUTTONDOWN
,
HTCAPTION
,
MAKELPARAM
(
x
,
y
));
ok_sequence
(
NCRBUTTONDOWNSeq
,
"WM_NCRBUTTONDOWN on caption"
,
FALSE
);
SetCursorPos
(
pos
.
x
,
pos
.
y
);
DefWindowProcA
(
hwnd
,
WM_ENDSESSION
,
1
,
0
);
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
==
WM_QUIT
)
gotwmquit
=
TRUE
;
...
...
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