Fix Windows mouse enter/leave event generation
authorMiikka Heikkinen <miikka.heikkinen@digia.com>
Mon, 1 Oct 2012 14:09:24 +0000 (17:09 +0300)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 4 Oct 2012 12:24:44 +0000 (14:24 +0200)
commitc1197677901648893856084178291078035f2bc2
treee0d9bda443f4b11feb733652fa22a29f3aab1f2d
parentdcc2e84fd0cdc90d633d2e5992ab1fc03e2aa861
Fix Windows mouse enter/leave event generation

QWidget::underMouse() did not report correct widget in cases where
mouse was grabbed by popup, which was especially disruptive in case
of QCompleter popup, as that wouldn't close anymore with off-popup
clicks.

Root problem was that mouse capture in Windows caused enter/leave
events for QWindows to be generated incorrectly.
QPlatformWindow documentation specifies that enter/leave events
should be sent independent of explicit mouse grabs and only automatic
mouse grabbing done when button is pressed should suppress
enter/leave events. Updated Windows mouse handling to conform to
this.

Task-number: QTBUG-27283
Change-Id: Iecf786a702f7d29e6026c42ff8ec4c9cbf1b6ac3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
src/plugins/platforms/windows/qwindowsmousehandler.cpp
src/plugins/platforms/windows/qwindowsmousehandler.h