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
b8338605
Commit
b8338605
authored
Apr 26, 2006
by
Thomas Kho
Committed by
Alexandre Julliard
May 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Fix behavior when selecting disabled menu items.
parent
76104e1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
menu.c
dlls/user/menu.c
+11
-5
menu.c
dlls/user/tests/menu.c
+3
-3
No files found.
dlls/user/menu.c
View file @
b8338605
...
...
@@ -2407,7 +2407,7 @@ static HMENU MENU_PtMenu( HMENU hMenu, POINT pt )
*
* Execute a menu item (for instance when user pressed Enter).
* Return the wID of the executed item. Otherwise, -1 indicating
* that no menu item was executed;
* that no menu item was executed
, -2 if a popup is shown
;
* Have to receive the flags for the TrackPopupMenu options to avoid
* sending unwanted message.
*
...
...
@@ -2444,7 +2444,10 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags )
}
}
else
{
pmt
->
hCurrentMenu
=
MENU_ShowSubPopup
(
pmt
->
hOwnerWnd
,
hMenu
,
TRUE
,
wFlags
);
return
-
2
;
}
return
-
1
;
}
...
...
@@ -2538,7 +2541,10 @@ static INT MENU_ButtonUp( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags)
if
(
item
&&
(
ptmenu
->
FocusedItem
==
id
))
{
if
(
!
(
item
->
fType
&
MF_POPUP
)
)
return
MENU_ExecFocusedItem
(
pmt
,
hPtMenu
,
wFlags
);
{
INT
executedMenuId
=
MENU_ExecFocusedItem
(
pmt
,
hPtMenu
,
wFlags
);
return
(
executedMenuId
<
0
)
?
-
1
:
executedMenuId
;
}
/* If we are dealing with the top-level menu */
/* and this is a click on an already "popped" item: */
...
...
@@ -3113,7 +3119,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
if
(
msg
.
wParam
==
'\r'
||
msg
.
wParam
==
' '
)
{
executedMenuId
=
MENU_ExecFocusedItem
(
&
mt
,
mt
.
hCurrentMenu
,
wFlags
);
fEndMenu
=
(
executedMenuId
!=
-
1
);
fEndMenu
=
(
executedMenuId
!=
-
2
);
break
;
}
...
...
@@ -3131,7 +3137,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
MENU_SelectItem
(
mt
.
hOwnerWnd
,
mt
.
hCurrentMenu
,
pos
,
TRUE
,
0
);
executedMenuId
=
MENU_ExecFocusedItem
(
&
mt
,
mt
.
hCurrentMenu
,
wFlags
);
fEndMenu
=
(
executedMenuId
!=
-
1
);
fEndMenu
=
(
executedMenuId
!=
-
2
);
}
}
break
;
...
...
@@ -3182,7 +3188,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
/* The return value is only used by TrackPopupMenu */
if
(
!
(
wFlags
&
TPM_RETURNCMD
))
return
TRUE
;
if
(
executedMenuId
==
-
1
)
executedMenuId
=
0
;
if
(
executedMenuId
<
0
)
executedMenuId
=
0
;
return
executedMenuId
;
}
...
...
dlls/user/tests/menu.c
View file @
b8338605
...
...
@@ -1509,7 +1509,7 @@ static struct menu_mouse_tests_s {
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
0
},
TRUE
,
FALSE
},
/* test 0 */
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_ESCAPE
,
0
},
FALSE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'D'
,
0
},
FALSE
,
TRU
E
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'D'
,
0
},
FALSE
,
FALS
E
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'E'
,
0
},
FALSE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
'M'
,
0
},
TRUE
,
FALSE
},
...
...
@@ -1517,11 +1517,11 @@ static struct menu_mouse_tests_s {
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
'M'
,
VK_ESCAPE
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_ESCAPE
,
0
},
FALSE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
'M'
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'D'
,
0
},
FALSE
,
TRU
E
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'D'
,
0
},
FALSE
,
FALS
E
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
'M'
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'E'
,
0
},
FALSE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
'M'
,
'P'
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'D'
,
0
},
FALSE
,
TRU
E
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'D'
,
0
},
FALSE
,
FALS
E
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
VK_LMENU
,
'M'
,
'P'
,
0
},
TRUE
,
FALSE
},
{
INPUT_KEYBOARD
,
{{
0
}},
{
'E'
,
0
},
FALSE
,
FALSE
},
...
...
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