diff options
author | Ken Moore <ken@ixsystems.com> | 2019-01-18 10:16:09 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2019-01-18 10:16:09 -0500 |
commit | 654ae5269f47202e8ceecdaad0d4f6e6a6cb85c3 (patch) | |
tree | 4ffe007c0f3cb633b28ddc3dc97462322b5a3833 | |
parent | Fix up the pkg-plist for the lumina-photo port. (diff) | |
download | lumina-654ae5269f47202e8ceecdaad0d4f6e6a6cb85c3.tar.gz lumina-654ae5269f47202e8ceecdaad0d4f6e6a6cb85c3.tar.bz2 lumina-654ae5269f47202e8ceecdaad0d4f6e6a6cb85c3.zip |
Adjust the cleanup of old QPalette within lthemeengine plugin.
Closes #638
This seems to prevent race conditions when switching between two palettes in the application
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp | 15 | ||||
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp index 621aa0ac..0d0046aa 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp @@ -180,11 +180,16 @@ void lthemeenginePlatformTheme::applySettings(){ if(!m_update){ m_update = true; } //Mouse Cursor syncronization - QString mthemefile = QDir::homePath()+"/.icons/default/index.theme"; + /*QString mthemefile = QDir::homePath()+"/.icons/default/index.theme"; if(!watcher->files().contains(mthemefile) && QFile::exists(mthemefile)){ watcher->addPath(mthemefile); //X11 mouse cursor theme file //qDebug() << "Add Mouse Cursor File to Watcher"; syncMouseCursorTheme(mthemefile); + }*/ + //Now cleanup any old palette as needed + if(outgoingpalette != 0){ + QCoreApplication::processEvents(); //make sure everything switches to the new palette first + delete outgoingpalette; } } #ifdef QT_WIDGETS_LIB @@ -216,17 +221,17 @@ void lthemeenginePlatformTheme::fileChanged(QString path){ } void lthemeenginePlatformTheme::readSettings(){ - if(m_customPalette){ - delete m_customPalette; + outgoingpalette = m_customPalette; + if(m_customPalette){ m_customPalette = 0; - } + } QSettings settings(lthemeengine::configFile(), QSettings::IniFormat); settings.beginGroup("Appearance"); m_style = settings.value("style", "Fusion").toString(); if(settings.value("custom_palette", false).toBool()){ QString schemePath = settings.value("color_scheme_path","airy").toString(); m_customPalette = new QPalette(loadColorScheme(schemePath)); - } + } m_cursorTheme = settings.value("cursor_theme","").toString(); m_iconTheme = settings.value("icon_theme", "material-design-light").toString(); settings.endGroup(); diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h index 359236b7..efe75013 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h @@ -70,6 +70,7 @@ private: QPalette loadColorScheme(QString filePath); QString m_style, m_iconTheme, m_userStyleSheet, m_oldStyleSheet, m_cursorTheme; QPalette *m_customPalette = nullptr; + QPalette *outgoingpalette = nullptr; QFont m_generalFont, m_fixedFont; int m_doubleClickInterval; int m_cursorFlashTime; |