History

Fix Window.setFocus() unsetting focus if Interface has focus

David Rowe committed 8 years ago

Commit 287ea8e1 parent d888e7f3 files · +12 −3Browse files

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

Unified · Split

interface/src/Application.cpp+10−0
@@ -7329,6 +7329,16 @@ bool Application::hasFocus() const { · 7328 unmodified lines
73297329 return (QApplication::activeWindow() != nullptr);
73307330 }
73317331
7332+void Application::setFocus() {
7333+ // Note: Windows doesn't allow a user focus to be taken away from another application. Instead, it changes the color of and
7334+ // flashes the taskbar icon.
7335+ auto window = qApp->getWindow();
7336+ window->activateWindow();
7337+
7338+ // Do NOT do the following because it takes focus away from the _displayPlugin.
7339+ //window->setFocus();
7340+}
7341+
73327342 void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
73337343 if (maxOctreePPS != _maxOctreePPS) {
73347344 _maxOctreePPS = maxOctreePPS;