Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit f8d59a48 authored by David Faure's avatar David Faure

ErrorOverlay: don't show by mistake if called with Running twice.

Summary:
If serverStateChanged(Running) is called twice, the first time
this would hide the overlay and set mOverlayActive=false,
so the second time this goes into the else branch, which
shows the overlay...

The reason it's called twice isn't because ServerManager
emits stateChanged(Running) twice, obviously (it only emits on actual
change). The reason is that the ErrorOverlay constructor calls
serverStateChanged(state) and connects to &ServerManager::stateChanged.
It can happen that for this initial state, ServerManager::state() finds
out "Running" before ServerManager gets a chance to notice by itself
and emit stateChanged().

BUG: 379997

Test Plan:
Found with debug output, during session startup,
over many weeks (it's clearly a race condition).

Reviewers: dvratil, vkrause

Reviewed By: dvratil

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D9264
parent f301d7d0
......@@ -207,11 +207,13 @@ void ErrorOverlay::serverStateChanged(ServerManager::State state)
return;
}
if (state == ServerManager::Running && mOverlayActive) {
mOverlayActive = false;
hide();
if (!mBaseWidgetIsParent) {
mBaseWidget->setEnabled(mPreviousState);
if (state == ServerManager::Running) {
if (mOverlayActive) {
mOverlayActive = false;
hide();
if (!mBaseWidgetIsParent) {
mBaseWidget->setEnabled(mPreviousState);
}
}
} else if (!mOverlayActive) {
mOverlayActive = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment