[vlc-commits] [Git][videolan/vlc][master] qt: do not adjust csd button state when the application is dying
    Steve Lhomme (@robUx4) 
    gitlab at videolan.org
       
    Fri Mar 28 07:11:00 UTC 2025
    
    
  
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
7df6b053 by Fatih Uzunoglu at 2025-03-28T06:54:26+00:00
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.
- - - - -
1 changed file:
- modules/gui/qt/maininterface/mainctx_win32.cpp
Changes:
=====================================
modules/gui/qt/maininterface/mainctx_win32.cpp
=====================================
@@ -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)
         {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7df6b053fc46c86d94269199a0b5b5e2a2c26127
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7df6b053fc46c86d94269199a0b5b5e2a2c26127
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
    
    
More information about the vlc-commits
mailing list