desktop/window: catch bad any cast tokens
This commit is contained in:
parent
e165f84184
commit
a492fa3866
1 changed files with 12 additions and 8 deletions
|
|
@ -463,11 +463,13 @@ void CWindow::moveToWorkspace(PHLWORKSPACE pWorkspace) {
|
||||||
if (TOKEN) {
|
if (TOKEN) {
|
||||||
if (*PINITIALWSTRACKING == 2) {
|
if (*PINITIALWSTRACKING == 2) {
|
||||||
// persistent
|
// persistent
|
||||||
SInitialWorkspaceToken token = std::any_cast<SInitialWorkspaceToken>(TOKEN->m_data);
|
try {
|
||||||
if (token.primaryOwner == m_self) {
|
SInitialWorkspaceToken token = std::any_cast<SInitialWorkspaceToken>(TOKEN->m_data);
|
||||||
token.workspace = pWorkspace->getConfigName();
|
if (token.primaryOwner == m_self) {
|
||||||
TOKEN->m_data = token;
|
token.workspace = pWorkspace->getConfigName();
|
||||||
}
|
TOKEN->m_data = token;
|
||||||
|
}
|
||||||
|
} catch (const std::bad_any_cast& e) { ; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -553,9 +555,11 @@ void CWindow::onUnmap() {
|
||||||
if (TOKEN) {
|
if (TOKEN) {
|
||||||
if (*PINITIALWSTRACKING == 2) {
|
if (*PINITIALWSTRACKING == 2) {
|
||||||
// persistent token, but the first window got removed so the token is gone
|
// persistent token, but the first window got removed so the token is gone
|
||||||
SInitialWorkspaceToken token = std::any_cast<SInitialWorkspaceToken>(TOKEN->m_data);
|
try {
|
||||||
if (token.primaryOwner == m_self)
|
SInitialWorkspaceToken token = std::any_cast<SInitialWorkspaceToken>(TOKEN->m_data);
|
||||||
g_pTokenManager->removeToken(TOKEN);
|
if (token.primaryOwner == m_self)
|
||||||
|
g_pTokenManager->removeToken(TOKEN);
|
||||||
|
} catch (const std::bad_any_cast& e) { g_pTokenManager->removeToken(TOKEN); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue