Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 33 files). Show all
Unified · Split
| @@ -74,16 +74,14 @@ QScriptValue WindowScriptingInterface::hasFocus() { · 73 unmodified lines | ||
| 74 | 74 | void WindowScriptingInterface::setFocus() { |
| 75 | 75 | // It's forbidden to call focus() from another thread. |
| 76 | 76 | qApp->postLambdaEvent([] { |
| 77 | − auto window = qApp->getWindow(); | |
| 78 | − window->activateWindow(); | |
| 79 | − window->setFocus(); | |
| 77 | + qApp->setFocus(); | |
| 80 | 78 | }); |
| 81 | 79 | } |
| 82 | 80 | |
| 83 | 81 | void WindowScriptingInterface::raiseMainWindow() { |
| 84 | 82 | // It's forbidden to call raise() from another thread. |
| 85 | 83 | qApp->postLambdaEvent([] { |
| 86 | − qApp->getWindow()->raise(); | |
| 84 | + qApp->raise(); | |
| 87 | 85 | }); |
| 88 | 86 | } |
| 89 | 87 | |