From 097107791f765a2996939e25463f79afe27be207 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 25 Apr 2020 20:17:34 +0900 Subject: Make sure to ignore applications that can't be restored. Signed-off-by: Michele Calgaro --- src/tqtraylabel.cpp | 4 ++++ src/traylabelmgr.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tqtraylabel.cpp b/src/tqtraylabel.cpp index 4e0b717..925ffd2 100644 --- a/src/tqtraylabel.cpp +++ b/src/tqtraylabel.cpp @@ -1070,6 +1070,10 @@ bool TQTrayLabel::restoreState(TDEConfig *config) dock(); scanClients(); // Grab window + if (mDockedWindow == None) + { + return false; + } if (mWithdrawn) { withdraw(); diff --git a/src/traylabelmgr.cpp b/src/traylabelmgr.cpp index 54b98bd..b011288 100644 --- a/src/traylabelmgr.cpp +++ b/src/traylabelmgr.cpp @@ -543,7 +543,11 @@ void TrayLabelMgr::doRestoreSession() { TRACE("Restoring Application[%s]", pname.ascii()); manageTrayLabel(new TQTrayLabel(TQStringList::split(" ", pname), 0)); - mTrayLabels.getFirst()->restoreState(config); + if (!mTrayLabels.getFirst()->restoreState(config)) + { + // Failed to restore the application, remove the tray label + delete mTrayLabels.take(0); + } } } } -- cgit v1.2.1