Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/dashboardwindow.cpp
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Line(s) | 171 | } else if (m_keyEventProxy && !m_keyEventProxy->hasActiveFocus() | |||
---|---|---|---|---|---|
185 | 185 | | |||
186 | QPointer<QQuickItem> previousFocusItem = activeFocusItem(); | 186 | QPointer<QQuickItem> previousFocusItem = activeFocusItem(); | ||
187 | 187 | | |||
188 | m_keyEventProxy->forceActiveFocus(); | 188 | m_keyEventProxy->forceActiveFocus(); | ||
189 | QEvent* eventCopy = new QKeyEvent(e->type(), e->key(), e->modifiers(), | 189 | QEvent* eventCopy = new QKeyEvent(e->type(), e->key(), e->modifiers(), | ||
190 | e->nativeScanCode(), e->nativeVirtualKey(), e->nativeModifiers(), | 190 | e->nativeScanCode(), e->nativeVirtualKey(), e->nativeModifiers(), | ||
191 | e->text(), e->isAutoRepeat(), e->count()); | 191 | e->text(), e->isAutoRepeat(), e->count()); | ||
192 | QCoreApplication::postEvent(this, eventCopy); | 192 | QCoreApplication::postEvent(this, eventCopy); | ||
193 | | ||||
194 | // We _need_ to do it twice to make sure the event ping-pong needed | ||||
195 | // for delivery happens before we sap focus again. | ||||
196 | QCoreApplication::processEvents(); | ||||
193 | QCoreApplication::processEvents(); | 197 | QCoreApplication::processEvents(); | ||
194 | 198 | | |||
195 | if (previousFocusItem) { | 199 | if (previousFocusItem) { | ||
196 | previousFocusItem->forceActiveFocus(); | 200 | previousFocusItem->forceActiveFocus(); | ||
197 | } | 201 | } | ||
198 | 202 | | |||
199 | return; | 203 | return; | ||
200 | } | 204 | } | ||
Show All 31 Lines |