winex11.drv: send WM_MOUSEACTIVATE before closing a window (try 3)

Lei Zhang thestig at
Tue Jun 19 01:26:25 CDT 2007

On 6/18/07, Dmitry Timoshkov <dmitry at> wrote:
> "Lei Zhang" <thestig at> wrote:
> > On Windows, clicking the close button of a nonactive window generates
> > a WM_MOUSEACTIVATE notification. Applications with custom window
> > procedures can then choose to ignore the close button if they wished
> I'm not sure what you mean by "applications with custom window procedures"
> because all (even simple ones) window procs in applications are custom, and
> they are free to handle/ignore any message they like, for instance WM_CLOSE
> We already send WM_MOUSEACTIVATE message on a take focus X11 event, so
> I don't see a point in duplicating it. On the other hand if a WM doesn't
> activate a window when a user clicks on window's caption (where the close
> button usually placed) then it's a WM bug and we can do nothing to fix it.
> --
> Dmitry.

Please try the sample program I attached to bug 8706. It has a window
procedure that does what I vaguely described here.

Are you sure a WM activates a window before sending the message to
close the window in reaction to the close button click event? If so,
then both Gnome and KDE would be buggy because the sample app I wrote
did not receive them with either of their WMs, nor did I see the code
that sends WM_MOUSEACTIVATE get called.

More information about the wine-devel mailing list