diff options
author | John Brooks <john.brooks@dereferenced.net> | 2014-10-15 15:55:36 -0600 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-10-29 21:11:58 +0100 |
commit | 136ccaa276574ba540f7fbed8173f7ae4c5680af (patch) | |
tree | bf8109e2f65bf903044717a2deb9ce1fec259921 /src/gui/kernel/qwindow.cpp | |
parent | 0b49ce2f8e69046766bd9eb9adb903ab1d73285f (diff) |
Ignore alert on an active window
When QWindow::alert() is called with a duration of 0, it calls
QPlatformWindow::setAlertState(true), and expects the alert state to be
reset when the window is next activated. Other calls to alert are
ignored while alertState is still true.
If alert was called for an active window, it would remain in the alert
state until deactivated and activated again, and on some platforms calls
to alert would be broken while deactivated.
Alerting doesn't make sense for active windows, so we can simply ignore
it, which was the behavior with Qt 4 on some platforms.
Change-Id: Ia3324da4c89db711b63eb31cddf0bf742bb4e3b8
Found-By: Jan Noertemann <jan.noertemann@uni-dortmund.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Martin Gräßlin <mgraesslin@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index af3b27fd10..b0fbbc1570 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2299,7 +2299,7 @@ QWindow *QWindow::fromWinId(WId id) /*! Causes an alert to be shown for \a msec miliseconds. If \a msec is \c 0 (the default), then the alert is shown indefinitely until the window becomes - active again. + active again. This function has no effect on an active window. In alert state, the window indicates that it demands attention, for example by flashing or bouncing the taskbar entry. @@ -2310,7 +2310,7 @@ QWindow *QWindow::fromWinId(WId id) void QWindow::alert(int msec) { Q_D(QWindow); - if (!d->platformWindow || d->platformWindow->isAlertState()) + if (!d->platformWindow || d->platformWindow->isAlertState() || isActive()) return; d->platformWindow->setAlertState(true); if (d->platformWindow->isAlertState() && msec) |