[PATCH] user32: Allow WM_CAPTURECHANGED indicating SetCapture() parameter
Chris Thielen
cthielen at gmail.com
Sun Jan 31 21:50:28 CST 2016
Thanks Ken, I'll make those changes.
On Sunday, January 31, 2016, Ken Thomases <ken at codeweavers.com> wrote:
> On Jan 31, 2016, at 7:18 PM, Christopher Thielen <cthielen at gmail.com
> <javascript:;>> wrote:
> >
> > A window may be notified with WM_CAPTURECHANGED about itself
> > gaining mouse capture if it calls SetCapture() twice.
> >
> > Tested on Windows XP and Fedora Workstation 22.
> >
> > Revised to simplify based on wine-devel feedback.
> > Revised to address any side-effects of new WM_CAPTURECHANGED
> > messages.
>
> The changes to comctl32 should be in a separate patch. In general,
> changes to different DLLs should be in separate patches unless it can't be
> avoided. The comctl32 patch should come before the change to when
> WM_CAPTURECHANGED is sent so that things aren't broken part-way through the
> patch series. You might also put the button.c changes in a separate patch,
> too.
>
> > case WM_CAPTURECHANGED:
> > - return TOOLBAR_CaptureChanged(infoPtr);
> > + if(hwnd != lParam)
> > + {
> > + return TOOLBAR_CaptureChanged(infoPtr);
> > + }
> > + else
> > + {
> > + return 0;
> > + }
>
> The second return can be hoisted out of the else since the true branch
> can't fall through. Also, you can reverse the logic, so the code can look
> like:
>
> case WM_CAPTURECHANGED:
> if(hwnd == lParam)
> return 0;
> return TOOLBAR_CaptureChanged(infoPtr);
>
> I think that's clearer and also a smaller diff. Same for the other files.
>
> Cheers,
> Ken
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160131/835fce15/attachment.html>
More information about the wine-devel
mailing list