[Bug 28629] New: TrackMouseEvent saves tracking data only for last caller's HWND

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Oct 9 14:16:00 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=28629

             Bug #: 28629
           Summary: TrackMouseEvent saves tracking data only for last
                    caller's HWND
           Product: Wine
           Version: 1.3.29
          Platform: x86
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: user32
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: b7.10110111 at gmail.com
    Classification: Unclassified


See this code from dlls/user32/input.c:

/* fill the TRACKMOUSEEVENT struct with the current tracking for the given hwnd
*/                  
if (ptme->dwFlags & TME_QUERY )                                                 
{                                                                               
    *ptme = tracking_info.tme;                                                  
    /* set cbSize in the case it's not initialized yet */                       
    ptme->cbSize = sizeof(TRACKMOUSEEVENT);                                     

    return TRUE; /* return here, TME_QUERY is retrieving information */         
}

Although the comment says it works per-hwnd, the code itself doesn't have any
logic concerning hwnd.

This problem makes button theming with hover support work incorrectly in
various cases. The easiest way to see this is as follows:
0. Configure some windowsXP theme, e.g. Luna or Royale
1. Start winecfg
2. Select "Libraries" tab
3. Press Edit (having at least one override)
4. Press Cancel on the dialog
5. Try to hover any button on the winecfg main window - it won't work.
The reason for this not working is that the "Edit Override" dialog's Cancel
button, being hovered, has called TrackMouseEvent for TME_LEAVE, and after
pressing it, it was destroyed, still leaving mouse tracking structure (global,
not per-hwnd, which is the core problem) in TME_LEAVE enabled state. Now, when
Edit or any other button becomes hovered, the structure returned on TME_QUERY
suggests that TME_LEAVE is enabled, so for Edit button's hwnd the timer isn't
set. 

So, the solution should be to make tracking_info per-hwnd, instead of global.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list