Commit 83545593 authored by David Edmundson's avatar David Edmundson

Avoid potential assert in SM saving

Summary:
Sesison Manager stores all relevant clients. There's an assert if the
window type is outside of the standard client window types. It assumed
that all windows outside this would be Unmanaged windows rather than
Client objects, something probably true but not something enforced.

This particular crash was probably cased as we have a new window type in
Plasma OSD, which does not set BypassWindowManager in Qt window flags.

BUG: 395712

Test Plan:
Set to restore session
Logged out and back in
Saw some windows

Set to restore manually saved session
Hit save
No crash

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13715
parent 3ce5af5c
......@@ -108,6 +108,11 @@ void Workspace::storeSession(KConfig* config, SMSavePhase phase)
for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) {
Client* c = (*it);
if (c->windowType() > NET::Splash) {
//window types outside this are not tooltips/menus/OSDs
//typically these will be unmanaged and not in this list anyway, but that is not enforced
continue;
}
QByteArray sessionId = c->sessionId();
QByteArray wmCommand = c->wmCommand();
if (sessionId.isEmpty())
......@@ -184,6 +189,9 @@ void Workspace::storeSubSession(const QString &name, QSet<QByteArray> sessionIds
int active_client = -1;
for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) {
Client* c = (*it);
if (c->windowType() > NET::Splash) {
continue;
}
QByteArray sessionId = c->sessionId();
QByteArray wmCommand = c->wmCommand();
if (sessionId.isEmpty())
......
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