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
26c751ea
Commit
26c751ea
authored
Oct 15, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Ignore tooltip position passed in TTM_TRACKPOSITION if TTF_TRACK flag is not set.
parent
7003bbdf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
tooltips.c
dlls/comctl32/tests/tooltips.c
+57
-0
tooltips.c
dlls/comctl32/tooltips.c
+1
-1
No files found.
dlls/comctl32/tests/tooltips.c
View file @
26c751ea
...
...
@@ -758,6 +758,62 @@ static void test_longtextW(void)
DestroyWindow
(
hwnd
);
}
static
BOOL
almost_eq
(
int
a
,
int
b
)
{
return
a
-
5
<
b
&&
a
+
5
>
b
;
}
static
void
test_track
(
void
)
{
WCHAR
textW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
0
};
TTTOOLINFOW
info
=
{
0
};
HWND
parent
,
tt
;
LRESULT
res
;
RECT
pos
;
parent
=
CreateWindowExW
(
0
,
WC_STATICW
,
NULL
,
WS_CAPTION
|
WS_VISIBLE
,
50
,
50
,
300
,
300
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
parent
!=
NULL
,
"creation of parent window failed
\n
"
);
ShowWindow
(
parent
,
SW_SHOWNORMAL
);
flush_events
(
100
);
tt
=
CreateWindowExW
(
WS_EX_TOPMOST
,
TOOLTIPS_CLASSW
,
NULL
,
TTS_NOPREFIX
|
TTS_ALWAYSTIP
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
parent
,
NULL
,
GetModuleHandleW
(
NULL
),
0
);
ok
(
tt
!=
NULL
,
"creation of tooltip window failed
\n
"
);
info
.
cbSize
=
TTTOOLINFO_V1_SIZE
;
info
.
uFlags
=
TTF_IDISHWND
|
TTF_TRACK
|
TTF_ABSOLUTE
;
info
.
hwnd
=
parent
;
info
.
hinst
=
GetModuleHandleW
(
NULL
);
info
.
lpszText
=
textW
;
info
.
uId
=
(
UINT_PTR
)
parent
;
GetClientRect
(
parent
,
&
info
.
rect
);
res
=
SendMessageW
(
tt
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
info
);
ok
(
res
,
"adding the tool to the tooltip failed
\n
"
);
SendMessageW
(
tt
,
TTM_SETDELAYTIME
,
TTDT_INITIAL
,
MAKELPARAM
(
1
,
0
));
SendMessageW
(
tt
,
TTM_TRACKACTIVATE
,
(
WPARAM
)
TRUE
,
(
LPARAM
)
&
info
);
SendMessageW
(
tt
,
TTM_TRACKPOSITION
,
0
,
MAKELPARAM
(
10
,
10
));
GetWindowRect
(
tt
,
&
pos
);
ok
(
almost_eq
(
pos
.
left
,
10
),
"pos.left = %d
\n
"
,
pos
.
left
);
ok
(
almost_eq
(
pos
.
top
,
10
),
"pos.top = %d
\n
"
,
pos
.
top
);
info
.
uFlags
=
TTF_IDISHWND
|
TTF_ABSOLUTE
;
SendMessageW
(
tt
,
TTM_SETTOOLINFO
,
0
,
(
LPARAM
)
&
info
);
SendMessageW
(
tt
,
TTM_TRACKPOSITION
,
0
,
MAKELPARAM
(
10
,
10
));
GetWindowRect
(
tt
,
&
pos
);
ok
(
!
almost_eq
(
pos
.
left
,
10
),
"pos.left = %d
\n
"
,
pos
.
left
);
ok
(
!
almost_eq
(
pos
.
top
,
10
),
"pos.top = %d
\n
"
,
pos
.
top
);
DestroyWindow
(
tt
);
DestroyWindow
(
parent
);
}
START_TEST
(
tooltips
)
{
InitCommonControls
();
...
...
@@ -768,4 +824,5 @@ START_TEST(tooltips)
test_ttm_gettoolinfo
();
test_longtextA
();
test_longtextW
();
test_track
();
}
dlls/comctl32/tooltips.c
View file @
26c751ea
...
...
@@ -626,7 +626,7 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
TOOLTIPS_CalcTipSize
(
infoPtr
,
&
size
);
TRACE
(
"size %d x %d
\n
"
,
size
.
cx
,
size
.
cy
);
if
(
track_activate
)
if
(
track_activate
&&
(
toolPtr
->
uFlags
&
TTF_TRACK
)
)
{
rect
.
left
=
infoPtr
->
xTrackPos
;
rect
.
top
=
infoPtr
->
yTrackPos
;
...
...
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