diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-11-09 15:57:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-15 11:59:34 +0100 |
commit | b8be2e67eae075e6c6108318e73c7ad4eddcebf8 (patch) | |
tree | 5ad0f199c7b56934d5b4ee7e21340990f6a421b6 /src/gui/kernel | |
parent | a6135c55b99e92a7d06f828e0ec0a4a35f89c47f (diff) |
Change to enter/leave policy while grabbing.
Sending enter and leave events to other windows than the grabbing
window is not logical. The policy should be that only the grabbing
window receives enter and leave events.
Changed the documentation accordingly and provided the necessary
changes to Windows implementation.
Also removed explicit leave event generation for widgets when
popup is opened as that is now redundant.
tst_QWidget::underMouse() test was changed to behave according to
new logic.
Task-number: QTBUG-27871
Change-Id: I127fb8685b4a4206d1a319f42cba491ec02bc8ca
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qplatformwindow.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 2bc6b01b3e..edd9a3d436 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -466,12 +466,18 @@ bool QPlatformWindow::frameStrutEventsEnabled() const \li Mouse grab: Qt expects windows to automatically grab the mouse if the user presses a button until the button is released. Automatic grab should be released if some window is explicitly grabbed. - \li Enter/Leave events: Enter and leave events should be sent independently of - explicit mouse grabs (\c{setMouseGrabEnabled()}). That is, if the mouse leaves - a window that has explicit mouse grab, a leave event should be sent and other - windows should get enter/leave events as well as the mouse traverses them. - For automatic mouse grab, however, a leave event should be sent when the - button is released. + \li Enter/Leave events: If there is a window explicitly grabbing mouse events + (\c{setMouseGrabEnabled()}), enter and leave events should only be sent to the + grabbing window when mouse cursor passes over the grabbing window boundary. + Other windows will not receive enter or leave events while the grab is active. + While an automatic mouse grab caused by a mouse button press is active, no window + will receive enter or leave events. When the last mouse button is released, the + autograbbing window will receive leave event if mouse cursor is no longer within + the window boundary. + When any grab starts, the window under cursor will receive a leave event unless + it is the grabbing window. + When any grab ends, the window under cursor will receive an enter event unless it + was the grabbing window. \li Window positioning: When calling \c{QWindow::setFramePos()}, the flag \c{QWindowPrivate::positionPolicy} is set to \c{QWindowPrivate::WindowFrameInclusive}. This means the position includes the window frame, whose size is at this point |