[PATCH] comctl32: Send EVENT_OBJECT_STATECHANGE when checking a checkbox

Alex Henrie alexhenrie24 at gmail.com
Tue Feb 8 02:23:24 CST 2022


On Tue, Feb 8, 2022 at 12:08 AM Alex Henrie <alexhenrie24 at gmail.com> wrote:
>
> On Mon, Feb 7, 2022 at 11:48 PM Alex Henrie <alexhenrie24 at gmail.com> wrote:
> >
> > On Mon, Feb 7, 2022 at 11:27 PM Nikolay Sivov <nsivov at codeweavers.com> wrote:
> > >
> > > > --- a/dlls/user32/tests/msg.c
> > > > +++ b/dlls/user32/tests/msg.c
> > > > @@ -1774,7 +1774,7 @@ static const struct message WmModalDialogSeq[] = {
> > > >       { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
> > > >       { WM_KILLFOCUS, sent|parent },
> > > >       { WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 },
> > > > -    { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
> > > > +    { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
> > > >       { WM_ENABLE, sent|parent|wparam, 0 },
> > > >       { HCBT_CREATEWND, hook },
> > > >       { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Not sent on Win10. */
> > > >
> > > Doesn't this still pass in wine, without comctl32 change, with or
> > > without winevent_hook_todo? I see we have winetest_platform checks
> > > around winevent_hook_todo.
> >
> > I don't think the platform check has anything to do with it, but I
> > just noticed that all of these tests pass todo=TRUE to ok_sequence,
> > which means that they do indeed pass whether or not
> > EVENT_OBJECT_STATECHANGE is specifically marked winevent_hook_todo. So
> > you're right, these are not good tests for the feature I'm trying to
> > implement.
>
> This must be what you were looking at:
>
>         /*
>          * silently drop hook messages if there is no support for them, mark
>          * winevent todo's.
>          */
>         else if ((expected->flags & optional) ||
>                  ((expected->flags & hook) && !hCBT_hook) ||
>                  ((expected->flags & winevent_hook) && !hEvent_hook) ||
>                  ((expected->flags & kbd_hook) && !hKBD_hook) ||
>                  ((expected->flags & winevent_hook_todo) &&
> !strcmp(winetest_platform, "wine")))
>
> Apparently ok_sequence treats all hooks as optional? That doesn't seem
> helpful...

It took me a minute but I think I get it: If we're expecting a hook
and don't get one, it's OK. But if we do get a hook, it had better be
the right one.

More importantly, I missed the fact that there are two (entirely?)
separate checkbox implementations in Windows: One in user32 and one in
comctl32. The one that NVDA uses is definitely in comctl32, but
comctl32's checkbox tests will have to be expanded to test hooks.

-Alex



More information about the wine-devel mailing list