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
0992d097
Commit
0992d097
authored
Mar 16, 2023
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Listbox shouldn't send WM_COMMAND/LBN_DBLCLK notification if it has no items.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
516f68b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
listbox.c
dlls/user32/listbox.c
+1
-1
msg.c
dlls/user32/tests/msg.c
+70
-0
No files found.
dlls/user32/listbox.c
View file @
0992d097
...
...
@@ -3113,7 +3113,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
return
LISTBOX_HandleLButtonDownCombo
(
descr
,
msg
,
wParam
,
(
INT16
)
LOWORD
(
lParam
),
(
INT16
)
HIWORD
(
lParam
)
);
if
(
descr
->
style
&
LBS_NOTIFY
)
if
(
(
descr
->
style
&
LBS_NOTIFY
)
&&
descr
->
nb_items
)
SEND_NOTIFICATION
(
descr
,
LBN_DBLCLK
);
return
0
;
case
WM_MOUSEMOVE
:
...
...
dlls/user32/tests/msg.c
View file @
0992d097
...
...
@@ -16543,6 +16543,12 @@ static const struct message wm_lb_addstring_sort_ownerdraw[] =
{
EVENT_OBJECT_CREATE
,
winevent_hook
|
wparam
|
lparam
|
winevent_hook_todo
,
OBJID_CLIENT
,
3
},
{
0
}
};
static
const
struct
message
wm_lb_dblclick_0
[]
=
{
{
WM_LBUTTONDBLCLK
,
sent
|
wparam
|
lparam
,
0
,
MAKELPARAM
(
1
,
1
)
},
{
WM_LBUTTONUP
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
0
}
};
#define check_lb_state(a1, a2, a3, a4, a5) check_lb_state_dbg(a1, a2, a3, a4, a5, __LINE__)
...
...
@@ -16687,6 +16693,25 @@ static void test_listbox_messages(void)
check_lb_state
(
listbox
,
0
,
-
1
,
0
,
0
);
flush_sequence
();
ret
=
SendMessageA
(
listbox
,
LB_DELETESTRING
,
0
,
0
);
ok
(
ret
==
LB_ERR
,
"expected LB_ERR, got %Id
\n
"
,
ret
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
flush_sequence
();
ret
=
SendMessageA
(
listbox
,
LB_RESETCONTENT
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
flush_sequence
();
if
(
winetest_debug
>
1
)
trace
(
"clicking on item 0
\n
"
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONDBLCLK
,
0
,
MAKELPARAM
(
1
,
1
));
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONUP
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ok_sequence
(
wm_lb_dblclick_0
,
"WM_LBUTTONDBLCLK 0"
,
FALSE
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
flush_sequence
();
log_all_parent_messages
--
;
DestroyWindow
(
listbox
);
...
...
@@ -16713,6 +16738,21 @@ static void test_listbox_messages(void)
ok_sequence
(
wm_lb_addstring_sort_ownerdraw
,
"LB_ADDSTRING"
,
FALSE
);
check_lb_state
(
listbox
,
3
,
LB_ERR
,
0
,
0
);
ret
=
SendMessageA
(
listbox
,
LB_RESETCONTENT
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
SetFocus
(
listbox
);
/* avoid focus messages */
flush_sequence
();
if
(
winetest_debug
>
1
)
trace
(
"clicking on item 0
\n
"
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONDBLCLK
,
0
,
MAKELPARAM
(
1
,
1
));
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONUP
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ok_sequence
(
wm_lb_dblclick_0
,
"WM_LBUTTONDBLCLK 0"
,
FALSE
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
flush_sequence
();
log_all_parent_messages
--
;
DestroyWindow
(
listbox
);
...
...
@@ -16739,6 +16779,21 @@ static void test_listbox_messages(void)
ok_sequence
(
wm_lb_addstring
,
"LB_ADDSTRING"
,
FALSE
);
check_lb_state
(
listbox
,
3
,
LB_ERR
,
0
,
0
);
ret
=
SendMessageA
(
listbox
,
LB_RESETCONTENT
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
SetFocus
(
listbox
);
/* avoid focus messages */
flush_sequence
();
if
(
winetest_debug
>
1
)
trace
(
"clicking on item 0
\n
"
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONDBLCLK
,
0
,
MAKELPARAM
(
1
,
1
));
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONUP
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ok_sequence
(
wm_lb_dblclick_0
,
"WM_LBUTTONDBLCLK 0"
,
FALSE
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
flush_sequence
();
log_all_parent_messages
--
;
DestroyWindow
(
listbox
);
...
...
@@ -16765,6 +16820,21 @@ static void test_listbox_messages(void)
ok_sequence
(
wm_lb_addstring
,
"LB_ADDSTRING"
,
FALSE
);
check_lb_state
(
listbox
,
3
,
LB_ERR
,
0
,
0
);
ret
=
SendMessageA
(
listbox
,
LB_RESETCONTENT
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
SetFocus
(
listbox
);
/* avoid focus messages */
flush_sequence
();
if
(
winetest_debug
>
1
)
trace
(
"clicking on item 0
\n
"
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONDBLCLK
,
0
,
MAKELPARAM
(
1
,
1
));
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ret
=
SendMessageA
(
listbox
,
WM_LBUTTONUP
,
0
,
0
);
ok
(
ret
==
LB_OKAY
,
"expected LB_OKAY, got %Id
\n
"
,
ret
);
ok_sequence
(
wm_lb_dblclick_0
,
"WM_LBUTTONDBLCLK 0"
,
FALSE
);
check_lb_state
(
listbox
,
0
,
LB_ERR
,
0
,
0
);
flush_sequence
();
log_all_parent_messages
--
;
DestroyWindow
(
listbox
);
...
...
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