diff options
author | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2010-04-03 14:02:42 +0200 |
---|---|---|
committer | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2010-04-03 14:02:42 +0200 |
commit | 95784118573f54e7c790fe5810d192d949b4f86b (patch) | |
tree | 285cfc23ec8e84b4865718f2ed8a8855f1a667c5 | |
parent | ff7795e6cc1f5fe1bfec0045b4b5c6c22df30eea (diff) |
Handle NPFocusEvent.
In addition to the missing multiple tlw support, there are
two bugs preventing this from working:
1. Qt calls actiwateWindow on QWidget::show (qwidget_lite.cpp). This
causes the window to render itself with focus at startup, even if
it doesn`t have it.
2. The plugin does not seem to get foucus out events.
-rw-r--r-- | src/gui/kernel/qeventdispatcher_pepper.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qeventdispatcher_pepper.cpp b/src/gui/kernel/qeventdispatcher_pepper.cpp index aa1f9b4bfb..8997b91806 100644 --- a/src/gui/kernel/qeventdispatcher_pepper.cpp +++ b/src/gui/kernel/qeventdispatcher_pepper.cpp @@ -591,10 +591,15 @@ void QEventDispatcherPepper::processMinimizeEvent(NPMinimizeEvent *minimize) void QEventDispatcherPepper::processFocusEvent(NPFocusEvent *focus) { - Q_UNUSED(focus) /* int32 value; */ + if (focus->value == 1) { + if (qApp->topLevelWidgets().isEmpty() == false) + qApp->setActiveWindow(qApp->topLevelWidgets().at(0)); // ### support for multiple tlws. + } else { + qApp->setActiveWindow(0); + } } void QEventDispatcherPepper::processDeviceEvent(NPDeviceEvent *device) |