mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 00:36:34 +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.
|
// flashes the taskbar icon.
|
||||||
auto window = qApp->getWindow();
|
auto window = qApp->getWindow();
|
||||||
window->activateWindow();
|
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) {
|
void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
|
||||||
|
|
|
@ -162,6 +162,7 @@ public:
|
||||||
glm::vec2 getDeviceSize() const;
|
glm::vec2 getDeviceSize() const;
|
||||||
bool hasFocus() const;
|
bool hasFocus() const;
|
||||||
void setFocus();
|
void setFocus();
|
||||||
|
void raise();
|
||||||
|
|
||||||
void showCursor(const Cursor::Icon& cursor);
|
void showCursor(const Cursor::Icon& cursor);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void WindowScriptingInterface::setFocus() {
|
||||||
void WindowScriptingInterface::raiseMainWindow() {
|
void WindowScriptingInterface::raiseMainWindow() {
|
||||||
// It's forbidden to call raise() from another thread.
|
// It's forbidden to call raise() from another thread.
|
||||||
qApp->postLambdaEvent([] {
|
qApp->postLambdaEvent([] {
|
||||||
qApp->getWindow()->raise();
|
qApp->raise();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public slots:
|
||||||
void setFocus();
|
void setFocus();
|
||||||
|
|
||||||
/**jsdoc
|
/**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
|
* @function Window.raiseMainWindow
|
||||||
*/
|
*/
|
||||||
void raiseMainWindow();
|
void raiseMainWindow();
|
||||||
|
|
Loading…
Reference in a new issue