From f31cee9366f1c3e5412221ee13a47c8c29056bcd Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 5 Nov 2014 14:31:30 +0100 Subject: [PATCH] Do not crash during global key presses. This crashed because on Android we called QWindowSystemInterface::handleKeyEvent() with QWindow argument set to 0 This is a regression and started to crash after commit d7ca800a8 (it added the call to tryHandleShortcutEvent() without checking the window pointer). Change-Id: Iefd5fe782a0f7f1e1569580ed4fcb2ef60eed2d2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/kernel/qwindowsysteminterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 073f351a8eb..ec158bdc40c 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -287,7 +287,7 @@ void QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Q void QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) { - if (t == QEvent::KeyPress && QWindowSystemInterface::tryHandleShortcutEvent(tlw, timestamp, k, mods, text)) + if (t == QEvent::KeyPress && tlw && QWindowSystemInterface::tryHandleShortcutEvent(tlw, timestamp, k, mods, text)) return; QWindowSystemInterfacePrivate::KeyEvent * e =