Skip to content
Snippets Groups Projects
Commit 7df6b053 authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Steve Lhomme
Browse files

qt: do not adjust csd button state when the application is dying

This is done to prevent crash when the csd close button is used.
parent 629d1d64
No related branches found
No related tags found
1 merge request!7077qt: fix sporadic crash when csd close button is clicked on windows
Pipeline #581229 passed with warnings with stage
in 14 minutes and 48 seconds
......@@ -502,6 +502,9 @@ private:
void hoverExclusive(CSDButton::ButtonType type)
{
if (Q_UNLIKELY(!qApp) || qApp->property("isDying").toBool())
return;
const auto& buttons = m_buttonmodel->windowCSDButtons();
std::for_each(buttons.begin(), buttons.end(), [type](const auto& button)
{
......@@ -511,6 +514,9 @@ private:
void handleButtonActionExclusive(CSDButton::ButtonType type, bool pressed)
{
if (Q_UNLIKELY(!qApp) || qApp->property("isDying").toBool())
return;
const auto& buttons = m_buttonmodel->windowCSDButtons();
std::for_each(buttons.begin(), buttons.end(), [type, pressed](const auto& button)
{
......@@ -531,6 +537,9 @@ private:
void resetPressedState()
{
if (Q_UNLIKELY(!qApp) || qApp->property("isDying").toBool())
return;
const auto& buttons = m_buttonmodel->windowCSDButtons();
std::for_each(buttons.begin(), buttons.end(), [](const auto& button)
{
......@@ -540,6 +549,9 @@ private:
void setAllUnhovered()
{
if (Q_UNLIKELY(!qApp) || qApp->property("isDying").toBool())
return;
const auto& buttons = m_buttonmodel->windowCSDButtons();
std::for_each(buttons.begin(), buttons.end(), [](const auto& button)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment