mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Fix Window.raiseMainWindow()
This commit is contained in:
parent
025d2807f4
commit
966d711e56
4 changed files with 17 additions and 5 deletions
|
@ -7362,9 +7362,20 @@ void Application::setFocus() {
|
|||
// flashes the taskbar icon.
|
||||
auto window = qApp->getWindow();
|
||||
window->activateWindow();
|
||||
|
||||
// Do NOT do the following because it takes focus away from the _displayPlugin.
|
||||
//window->setFocus();
|
||||
}
|
||||
|
||||
void Application::raise() {
|
||||
auto windowState = qApp->getWindow()->windowState();
|
||||
if (windowState & Qt::WindowMinimized) {
|
||||
if (windowState & Qt::WindowMaximized) {
|
||||
qApp->getWindow()->showMaximized();
|
||||
} else if (windowState & Qt::WindowFullScreen) {
|
||||
qApp->getWindow()->showFullScreen();
|
||||
} else {
|
||||
qApp->getWindow()->showNormal();
|
||||
}
|
||||
}
|
||||
qApp->getWindow()->raise();
|
||||
}
|
||||
|
||||
void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
|
||||
|
|
|
@ -162,6 +162,7 @@ public:
|
|||
glm::vec2 getDeviceSize() const;
|
||||
bool hasFocus() const;
|
||||
void setFocus();
|
||||
void raise();
|
||||
|
||||
void showCursor(const Cursor::Icon& cursor);
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ void WindowScriptingInterface::setFocus() {
|
|||
void WindowScriptingInterface::raiseMainWindow() {
|
||||
// It's forbidden to call raise() from another thread.
|
||||
qApp->postLambdaEvent([] {
|
||||
qApp->getWindow()->raise();
|
||||
qApp->raise();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public slots:
|
|||
void setFocus();
|
||||
|
||||
/**jsdoc
|
||||
* Raise the Interface window if it is minimized, and give it focus.
|
||||
* Raise the Interface window if it is minimized. If raised, the window gains focus.
|
||||
* @function Window.raiseMainWindow
|
||||
*/
|
||||
void raiseMainWindow();
|
||||
|
|
Loading…
Reference in a new issue