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
68f2b878
Commit
68f2b878
authored
Apr 16, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Allow EndMenu() calls from WM_ENTERMENULOOP.
parent
09721aca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
menu.c
dlls/user32/menu.c
+10
-3
menu.c
dlls/user32/tests/menu.c
+3
-12
No files found.
dlls/user32/menu.c
View file @
68f2b878
...
@@ -3015,7 +3015,6 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -3015,7 +3015,6 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
TRACE
(
"hmenu=%p flags=0x%08x (%d,%d) hwnd=%p %s
\n
"
,
TRACE
(
"hmenu=%p flags=0x%08x (%d,%d) hwnd=%p %s
\n
"
,
hmenu
,
wFlags
,
x
,
y
,
hwnd
,
wine_dbgstr_rect
(
lprect
));
hmenu
,
wFlags
,
x
,
y
,
hwnd
,
wine_dbgstr_rect
(
lprect
));
fEndMenu
=
FALSE
;
if
(
!
(
menu
=
MENU_GetMenu
(
hmenu
)))
if
(
!
(
menu
=
MENU_GetMenu
(
hmenu
)))
{
{
WARN
(
"Invalid menu handle %p
\n
"
,
hmenu
);
WARN
(
"Invalid menu handle %p
\n
"
,
hmenu
);
...
@@ -3306,12 +3305,20 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
...
@@ -3306,12 +3305,20 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
HideCaret
(
0
);
HideCaret
(
0
);
if
(
!
(
menu
=
MENU_GetMenu
(
hMenu
)))
return
FALSE
;
/* This makes the menus of applications built with Delphi work.
/* This makes the menus of applications built with Delphi work.
* It also enables menus to be displayed in more than one window,
* It also enables menus to be displayed in more than one window,
* but there are some bugs left that need to be fixed in this case.
* but there are some bugs left that need to be fixed in this case.
*/
*/
if
(
!
bPopup
&&
(
menu
=
MENU_GetMenu
(
hMenu
)))
menu
->
hWnd
=
hWnd
;
if
(
!
bPopup
)
menu
->
hWnd
=
hWnd
;
if
(
!
top_popup
)
top_popup_hmenu
=
hMenu
;
if
(
!
top_popup
)
{
top_popup
=
menu
->
hWnd
;
top_popup_hmenu
=
hMenu
;
}
fEndMenu
=
FALSE
;
/* Send WM_ENTERMENULOOP and WM_INITMENU message only if TPM_NONOTIFY flag is not specified */
/* Send WM_ENTERMENULOOP and WM_INITMENU message only if TPM_NONOTIFY flag is not specified */
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
...
...
dlls/user32/tests/menu.c
View file @
68f2b878
...
@@ -3324,17 +3324,11 @@ static void test_menu_cancelmode(void)
...
@@ -3324,17 +3324,11 @@ static void test_menu_cancelmode(void)
/* menu owner is top level window */
/* menu owner is top level window */
g_hwndtosend
=
hwnd
;
g_hwndtosend
=
hwnd
;
TrackPopupMenu
(
menu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
hwnd
,
NULL
);
TrackPopupMenu
(
menu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
hwnd
,
NULL
);
todo_wine
{
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
}
ok
(
g_got_enteridle
<
2
,
"received %d WM_ENTERIDLE messages, should be less than 2
\n
"
,
g_got_enteridle
);
/* menu owner is child window */
/* menu owner is child window */
g_hwndtosend
=
hwndchild
;
g_hwndtosend
=
hwndchild
;
TrackPopupMenu
(
menu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
hwndchild
,
NULL
);
TrackPopupMenu
(
menu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
hwndchild
,
NULL
);
todo_wine
{
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
}
ok
(
g_got_enteridle
<
2
,
"received %d WM_ENTERIDLE messages, should be less than 2
\n
"
,
g_got_enteridle
);
/* now send the WM_CANCELMODE messages to the WRONG window */
/* now send the WM_CANCELMODE messages to the WRONG window */
/* those should fail ( to have any effect) */
/* those should fail ( to have any effect) */
g_hwndtosend
=
hwnd
;
g_hwndtosend
=
hwnd
;
...
@@ -3354,10 +3348,7 @@ static void test_menu_cancelmode(void)
...
@@ -3354,10 +3348,7 @@ static void test_menu_cancelmode(void)
ok
(
ret
==
0
,
"Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u
\n
"
,
GetLastError
());
ok
(
ret
==
0
,
"Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u
\n
"
,
GetLastError
());
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
DispatchMessageA
(
&
msg
);
todo_wine
{
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
}
ok
(
g_got_enteridle
<
2
,
"received %d WM_ENTERIDLE messages, should be less than 2
\n
"
,
g_got_enteridle
);
/* cleanup */
/* cleanup */
DestroyMenu
(
menubar
);
DestroyMenu
(
menubar
);
...
...
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