[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Some code ambiguity in tab control code.
From: John Found <johnfound () asm32 ! info>
Date: 2016-09-29 21:49:14
Message-ID: 20160930004914.2670088cdf705308dcc34415 () asm32 ! info
[Download RAW message or body]
Hi.
Trying without success to show tooltips for a tabcontrol, I found the following \
problems in the source code. Notice, that my skills in C++ are poor, so it is very \
possible the following is a false alarm.
I am quote https://github.com/wine-mirror/wine/blob/master/dlls/comctl32/tab.c (hope \
it is the proper source code)
This seems to be a bug: WM_LBUTTONDOWN is relayed in the WM_MOUSEMOVE handler. But \
WM_LBUTTONDOWN will always hide the tooltip. WM_MOUSEMOVE instead will set the timer \
for showing the tooltip.
> static LRESULT
> TAB_MouseMove (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
> {
> int redrawLeave;
> int redrawEnter;
>
> if (infoPtr->hwndToolTip)
> TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,
> WM_LBUTTONDOWN, wParam, lParam);
>
> /* Determine which tab to highlight. Redraw tabs which change highlight
> ** status. */
> TAB_RecalcHotTrack(infoPtr, &lParam, &redrawLeave, &redrawEnter);
>
> hottrack_refresh (infoPtr, redrawLeave);
> hottrack_refresh (infoPtr, redrawEnter);
>
> return 0;
> }
The WM_LBUTTONDOWN is relayed twice? Why? It is not exactly a bug, but sub-optimal.
> static LRESULT
> TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
> {
> POINT pt;
> INT newItem;
> UINT dummy;
>
> if (infoPtr->hwndToolTip)
> TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,
> WM_LBUTTONDOWN, wParam, lParam);
>
> if (!(infoPtr->dwStyle & TCS_FOCUSNEVER)) {
> SetFocus (infoPtr->hwnd);
> }
>
> if (infoPtr->hwndToolTip)
> TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,
> WM_LBUTTONDOWN, wParam, lParam);
>
--
http://fresh.flatassembler.net
http://asm32.info
John Found <johnfound@asm32.info>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic