History

Working on keyboard focus issues

Brad Davis committed 10 years ago

Commit 5aa83981 parent cf8d2c55 files · +38 −73Browse files

Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all

Unified · Split

interface/src/Application.cpp+5−0
@@ -2191,6 +2191,11 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 2190 unmodified lines
21912191 _altPressed = false;
21922192
21932193 auto offscreenUi = DependencyManager::get<OffscreenUi>();
2194+ // If we get a mouse press event it means it wasn't consumed by the offscreen UI,
2195+ // hence, we should defocus all of the offscreen UI windows, in order to allow
2196+ // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews
2197+ // will consume all keyboard events.
2198+ offscreenUi->unfocusWindows();
21942199 QPointF transformedPos = offscreenUi->mapToVirtualScreen(event->localPos(), _glWidget);
21952200 QMouseEvent mappedEvent(event->type(),
21962201 transformedPos,