summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-04-23 12:24:23 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-04-23 12:24:23 (GMT)
commit4dba5cc0085482dccfbe70d8c157e094296feed1 (patch)
treef6c9b2b527f0a3823405362ef0b90e69e9265430 /src
parent9206f0f867e39bbcfa2670a7ba71211b7384c601 (diff)
parent466d7562a40eb0c2cf72f57fce0bc5e9b0de37c2 (diff)
downloadQt-4dba5cc0085482dccfbe70d8c157e094296feed1.zip
Qt-4dba5cc0085482dccfbe70d8c157e094296feed1.tar.gz
Qt-4dba5cc0085482dccfbe70d8c157e094296feed1.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp13
-rw-r--r--src/gui/widgets/qmenu_mac.mm2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index f259654..a7145d4 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -756,14 +756,23 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
return true;
}
- if (qApp->inputContext() && qApp->inputContext()->isComposing()) {
+ QInputContext *currentContext = qApp->inputContext();
+ if (currentContext && currentContext->isComposing()) {
if (ekind == kEventRawKeyDown) {
- QMacInputContext *context = qobject_cast<QMacInputContext*>(qApp->inputContext());
+ QMacInputContext *context = qobject_cast<QMacInputContext*>(currentContext);
if (context)
context->setLastKeydownEvent(event);
}
return false;
}
+ // Once we process the key down , we dont need to send the saved event again from
+ // kEventTextInputUnicodeForKeyEvent, so clear it.
+ if (currentContext && ekind == kEventRawKeyDown) {
+ QMacInputContext *context = qobject_cast<QMacInputContext*>(currentContext);
+ if (context)
+ context->setLastKeydownEvent(0);
+ }
+
//get modifiers
Qt::KeyboardModifiers modifiers;
int qtKey;
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 7645c23..e8400d6 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1831,7 +1831,7 @@ void QMenuBarPrivate::macDestroyMenuBar()
menubars()->remove(tlw);
mac_menubar = 0;
- if (qt_mac_current_menubar.qmenubar == q) {
+ if (!qt_mac_current_menubar.qmenubar || qt_mac_current_menubar.qmenubar == q) {
#ifdef QT_MAC_USE_COCOA
QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
[loader removeActionsFromAppMenu];