Send key events to the active window when tlw in qpa event is null

Change-Id: Ie055918276d716b0f4f23b6a9d34c23c5459d960
Reviewed-on: http://codereview.qt-project.org/5777
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
bb10
Laszlo Agocs 2011-09-29 10:28:28 +03:00 committed by Qt by Nokia
parent b863df7de9
commit fc8b62222c
2 changed files with 4 additions and 1 deletions

View File

@ -636,6 +636,8 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)
{
QWindow *window = e->window.data();
if (e->nullWindow)
window = QGuiApplication::activeWindow();
if (!window)
return;

View File

@ -128,8 +128,9 @@ public:
class UserEvent : public WindowSystemEvent {
public:
UserEvent(QWindow * w, ulong time, EventType t)
: WindowSystemEvent(t), window(w), timestamp(time) { }
: WindowSystemEvent(t), window(w), nullWindow(w == 0), timestamp(time) { }
QWeakPointer<QWindow> window;
bool nullWindow;
unsigned long timestamp;
};