Avoid calling gtk_window_get_position() from "configure-event" handler, if possible.
This avoids a round trip to the X server, which is expensive over a remote connection.
Closes #15116


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
avoid duplicate move events

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
should have been part of r74664: Avoid calling gtk_window_get_position() from "configure-event" handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No changes, just move mouse capturing bookkeeping data out of wxWindow.

All mouse capture-related data doesn't have to be declared in wxWindow itself
and can just be global in wincmn.cpp, so move it there, this will facilitate
further changes as they won't require recompiling everything any more.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No changes, just use wxRecursionGuard instead of manual boolean flag.

Use wxRecursionGuard with the flag indicating whether the mouse capture is
changing to ensure that we always reset it correctly and make the code
slightly shorter.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No changes, just change data structures used by mouse capture code.

Use a simple stack of windows instead of a separate singly linked list and a
separate current capture pointer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't set even try to set focus to wxPopupWindow itself in wxMSW.

This doesn't work anyhow with our popup window implementation (it's a child of
the desktop and we can't set focus to it) and provokes error messages due to
::SetFocus() failures, so simply don't do this at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make mouse capture checking asserts stronger and more detailed.

Verify not only that we don't destroy the window having the capture now but
also that this window is not in the mouse capture stack at all, not
necessarily on top. This is important as keeping a dangling pointer in the
capture stack would result in difficult to diagnose bugs later.

Also check that we don't recapture the mouse in the same window as this should
never be necessary.

Finally, give more details in the assert checking that the window does have
capture in ReleaseMouse().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Return NULL from wxWindow::GetCapture() when the capture is being lost.

Make GetCapture() return NULL during wxEVT_MOUSE_CAPTURE_{LOST,CHANGED} events
processing in wxMSW to help their handlers to avoid calling ReleaseCapture():
this shouldn't be done as the mouse capture is being lost anyhow and results
in reentrancy problems between NotifyCaptureLost() and ReleaseCapture() if
it's called.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxFindWindowAtPoint() for hit testing in wxPopupTransientWindow.

This works even with irregularly shaped windows such as wxRichToolTip unlike
the old naive test using wxRect::Contains() which didn't and resulted in us
believing that the mouse was outside the window when it was still in it and
(somehow, the details are not totally clear) recapturing the mouse again and
again in the same window which resulted in assert failures with the new checks
in wxWindowBase::CaptureMouse() or the capture stack corruption before this.

Closes #15288.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Only give capture to wxPopupTransientWindow child if it's the only one.

This removes the arbitrariness of using the first child which didn't make any
sense when the popup had several controls inside it, e.g. in wxRichToolTip
case this resulted in the mouse capture being given to wxStaticBitmap showing
the tooltip icon even though it didn't need it at all.

This probably doesn't really change the observable behaviour but seems more
logical.

See #15288.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Move code that does not need realized GdkWinow out of realize handler
These calls can be made much earlier, and it seems like a good idea to do so.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
avoid setting initial position if it was not specified, broken in r70734

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775