mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 07:37:28 +02:00
Fix Window.hasFocus()
This commit is contained in:
parent
16aefea2e1
commit
c8b4217a96
1 changed files with 8 additions and 4 deletions
|
@ -7347,10 +7347,14 @@ bool Application::isThrottleRendering() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Application::hasFocus() const {
|
bool Application::hasFocus() const {
|
||||||
if (_displayPlugin) {
|
bool result = (QApplication::activeWindow() != nullptr);
|
||||||
return getActiveDisplayPlugin()->hasFocus();
|
#if defined(Q_OS_WIN)
|
||||||
}
|
// On Windows, QWidget::activateWindow() - as called in setFocus() - makes the application's taskbar icon flash but doesn't
|
||||||
return (QApplication::activeWindow() != nullptr);
|
// take user focus away from their current window. So also check whether the application is the user's current foreground
|
||||||
|
// window.
|
||||||
|
result = result && (HWND)QApplication::activeWindow()->winId() == GetForegroundWindow();
|
||||||
|
#endif
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setFocus() {
|
void Application::setFocus() {
|
||||||
|
|
Loading…
Reference in a new issue