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
0645fa13
Commit
0645fa13
authored
Apr 30, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/toolbar: Fix tooltip notification forwarding.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e7e3cbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
8 deletions
+54
-8
toolbar.c
dlls/comctl32/tests/toolbar.c
+1
-2
toolbar.c
dlls/comctl32/toolbar.c
+53
-6
No files found.
dlls/comctl32/tests/toolbar.c
View file @
0645fa13
...
...
@@ -56,7 +56,6 @@ static BOOL g_ResetDispTextPtr;
static
const
struct
message
ttgetdispinfo_parent_seq
[]
=
{
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TBN_GETINFOTIPA
},
/* next line is todo, currently TTN_GETDISPINFOW is raised here */
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TTN_GETDISPINFOA
},
{
0
}
};
...
...
@@ -2026,7 +2025,7 @@ static void test_tooltip(void)
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
SendMessageA
(
hToolbar
,
WM_NOTIFY
,
0
,
(
LPARAM
)
&
nmtti
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
ttgetdispinfo_parent_seq
,
"dispinfo from tooltip"
,
TRU
E
);
"dispinfo from tooltip"
,
FALS
E
);
g_ResetDispTextPtr
=
TRUE
;
SendMessageA
(
hToolbar
,
WM_NOTIFY
,
0
,
(
LPARAM
)
&
nmtti
);
...
...
dlls/comctl32/toolbar.c
View file @
0645fa13
...
...
@@ -6118,6 +6118,9 @@ TOOLBAR_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam)
static
LRESULT
TOOLBAR_TTGetDispInfo
(
TOOLBAR_INFO
*
infoPtr
,
NMTTDISPINFOW
*
lpnmtdi
)
{
int
index
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
lpnmtdi
->
hdr
.
idFrom
,
FALSE
);
NMTTDISPINFOA
nmtdi
;
unsigned
int
len
;
LRESULT
ret
;
TRACE
(
"button index = %d
\n
"
,
index
);
...
...
@@ -6131,7 +6134,6 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
{
WCHAR
wszBuffer
[
INFOTIPSIZE
+
1
];
NMTBGETINFOTIPW
tbgit
;
unsigned
int
len
;
/* in chars */
wszBuffer
[
0
]
=
'\0'
;
wszBuffer
[
INFOTIPSIZE
]
=
'\0'
;
...
...
@@ -6169,7 +6171,6 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
{
CHAR
szBuffer
[
INFOTIPSIZE
+
1
];
NMTBGETINFOTIPA
tbgit
;
unsigned
int
len
;
/* in chars */
szBuffer
[
0
]
=
'\0'
;
szBuffer
[
INFOTIPSIZE
]
=
'\0'
;
...
...
@@ -6210,7 +6211,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
!
(
infoPtr
->
buttons
[
index
].
fsStyle
&
BTNS_SHOWTEXT
))
{
LPWSTR
pszText
=
TOOLBAR_GetText
(
infoPtr
,
&
infoPtr
->
buttons
[
index
]);
unsigned
int
len
=
pszText
?
strlenW
(
pszText
)
:
0
;
len
=
pszText
?
strlenW
(
pszText
)
:
0
;
TRACE
(
"using button hidden text %s
\n
"
,
debugstr_w
(
pszText
));
...
...
@@ -6236,9 +6237,55 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
TRACE
(
"Sending tooltip notification to %p
\n
"
,
infoPtr
->
hwndNotify
);
/* last resort: send notification on to app */
/* FIXME: find out what is really used here */
return
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
lpnmtdi
->
hdr
.
idFrom
,
(
LPARAM
)
lpnmtdi
);
/* Last resort, forward TTN_GETDISPINFO to the app:
- NFR_UNICODE gets TTN_GETDISPINFOW, and TTN_GETDISPINFOA if -W returned no text;
- NFR_ANSI gets only TTN_GETDISPINFOA.
*/
if
(
infoPtr
->
bUnicode
)
{
ret
=
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
lpnmtdi
->
hdr
.
idFrom
,
(
LPARAM
)
lpnmtdi
);
TRACE
(
"TTN_GETDISPINFOW - got string %s
\n
"
,
debugstr_w
(
lpnmtdi
->
lpszText
));
if
(
lpnmtdi
->
lpszText
&&
*
lpnmtdi
->
lpszText
)
return
ret
;
}
nmtdi
.
hdr
.
hwndFrom
=
lpnmtdi
->
hdr
.
hwndFrom
;
nmtdi
.
hdr
.
idFrom
=
lpnmtdi
->
hdr
.
idFrom
;
nmtdi
.
hdr
.
code
=
TTN_GETDISPINFOA
;
nmtdi
.
lpszText
=
nmtdi
.
szText
;
nmtdi
.
szText
[
0
]
=
0
;
nmtdi
.
hinst
=
lpnmtdi
->
hinst
;
nmtdi
.
uFlags
=
lpnmtdi
->
uFlags
;
nmtdi
.
lParam
=
lpnmtdi
->
lParam
;
ret
=
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
nmtdi
.
hdr
.
idFrom
,
(
LPARAM
)
&
nmtdi
);
TRACE
(
"TTN_GETDISPINFOA - got string %s
\n
"
,
debugstr_a
(
nmtdi
.
lpszText
));
if
(
!
nmtdi
.
lpszText
||
!*
nmtdi
.
lpszText
)
return
ret
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
nmtdi
.
lpszText
,
-
1
,
NULL
,
0
);
if
(
len
>
ARRAY_SIZE
(
lpnmtdi
->
szText
))
{
infoPtr
->
pszTooltipText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
if
(
infoPtr
->
pszTooltipText
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
nmtdi
.
lpszText
,
-
1
,
infoPtr
->
pszTooltipText
,
len
);
lpnmtdi
->
lpszText
=
infoPtr
->
pszTooltipText
;
return
0
;
}
}
else
{
MultiByteToWideChar
(
CP_ACP
,
0
,
nmtdi
.
lpszText
,
-
1
,
lpnmtdi
->
lpszText
,
ARRAY_SIZE
(
nmtdi
.
szText
));
return
0
;
}
return
ret
;
}
...
...
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