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
7329 return (QApplication::activeWindow() != nullptr);7329 return (QApplication::activeWindow() != nullptr);
7330}7330}
7331 7331
7332void 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
7332void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {7342void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
7333 if (maxOctreePPS != _maxOctreePPS) {7343 if (maxOctreePPS != _maxOctreePPS) {
7334 _maxOctreePPS = maxOctreePPS;7344 _maxOctreePPS = maxOctreePPS;