summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-02-14 08:32:26 (GMT)
committerEckhart Koppen <eckhart.koppen@nokia.com>2011-02-15 06:02:03 (GMT)
commit6415f2814ae30d162e335d1ffd6d093b12701f03 (patch)
tree745b0bbfc2a57a9d92a08bfda7d72900621a71c6 /src/gui/kernel/qwidget_mac.mm
parente5152123c7fea830c522916a2bb9c16583d5f666 (diff)
downloadQt-6415f2814ae30d162e335d1ffd6d093b12701f03.zip
Qt-6415f2814ae30d162e335d1ffd6d093b12701f03.tar.gz
Qt-6415f2814ae30d162e335d1ffd6d093b12701f03.tar.bz2
Cocoa/Alien: bugfix corner cases with popups and enter/leave
It turns out that we sometimes hit a strange bug with enter/leave events when a popup is showing. If you righpress to show the popup, and then move the mouse outside the window, we get a continues series of leave events. This patch separates more the native vs alien logic for dispatching enter/leave to accommondate this problem
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 3ba12cd..9a5a5f1 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -186,6 +186,7 @@ extern void qt_mac_event_release(QWidget *w); //qapplication_mac.mm
extern void qt_event_request_showsheet(QWidget *); //qapplication_mac.mm
extern void qt_event_request_window_change(QWidget *); //qapplication_mac.mm
extern QPointer<QWidget> qt_last_mouse_receiver; //qapplication_mac.mm
+extern QPointer<QWidget> qt_last_native_mouse_receiver; //qt_cocoa_helpers_mac.mm
extern IconRef qt_mac_create_iconref(const QPixmap &); //qpixmap_mac.cpp
extern void qt_mac_set_cursor(const QCursor *, const QPoint &); //qcursor_mac.mm
extern void qt_mac_update_cursor(); //qcursor_mac.mm
@@ -3524,6 +3525,8 @@ void QWidgetPrivate::show_sys()
qt_mac_getTargetForMouseEvent(0, QEvent::Enter, qlocal, qglobal, 0, &widgetUnderMouse);
QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, qt_last_mouse_receiver);
qt_last_mouse_receiver = widgetUnderMouse;
+ qt_last_native_mouse_receiver = widgetUnderMouse ?
+ (widgetUnderMouse->internalWinId() ? widgetUnderMouse : widgetUnderMouse->nativeParentWidget()) : 0;
}
#endif
@@ -3676,8 +3679,10 @@ void QWidgetPrivate::hide_sys()
QPoint qlocal, qglobal;
QWidget *widgetUnderMouse = 0;
qt_mac_getTargetForMouseEvent(0, QEvent::Leave, qlocal, qglobal, 0, &widgetUnderMouse);
- QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, qt_last_mouse_receiver);
+ QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, qt_last_native_mouse_receiver);
qt_last_mouse_receiver = widgetUnderMouse;
+ qt_last_native_mouse_receiver = widgetUnderMouse ?
+ (widgetUnderMouse->internalWinId() ? widgetUnderMouse : widgetUnderMouse->nativeParentWidget()) : 0;
}
#endif