From c131208e59f5b2dd517b00c4539458760b8fd8aa Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 8 Apr 2009 10:45:41 +0200 Subject: BT: Fix infinite recursion potential from change acff913a6287ad50b0ac782 It seems there is a potential for recursion because calling keyDown: can bubble up to the window which will start the process all over again. keyDown: will actually call qt_dispatchKeyEvent(), we may as well short it out here. All the previous cases I tried continue to work and we don't crash Creator if you are really impatient hitting keys. --- src/gui/widgets/qcocoamenu_mac.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index bae270a..bd62a00 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -159,10 +159,11 @@ QT_END_NAMESPACE accel_ev.ignore(); qt_sendSpontaneousEvent(widget, &accel_ev); if (accel_ev.isAccepted()) { - *target = nil; - *action = nil; - [qt_mac_nativeview_for(widget) keyDown:event]; - return YES; + if (qt_dispatchKeyEvent(event, widget)) { + *target = nil; + *action = nil; + return YES; + } } } } -- cgit v0.12