Add an explicit dependency to Breeze to find decoration plugin
Summary: KWin needs the plugin id of the breeze decoration plugin. Instead of hard coding that it's now resolved through an optional dependency. If the optional dependency is not available, the default is adjusted to aurorae/plastik. Reviewers: #plasma Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1344
This commit is contained in:
parent
18939e17ed
commit
5646313c2c
4 changed files with 36 additions and 4 deletions
|
@ -122,6 +122,21 @@ set_package_properties(KScreenLocker PROPERTIES
|
|||
TYPE REQUIRED
|
||||
PURPOSE "For screenlocker integration in kwin_wayland")
|
||||
|
||||
find_package(Breeze ${PROJECT_VERSION} CONFIG)
|
||||
set_package_properties(Breeze PROPERTIES
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "For setting the default window decoration plugin")
|
||||
if(${Breeze_FOUND})
|
||||
if(${BREEZE_WITH_KDECORATION})
|
||||
set(HAVE_BREEZE_DECO true)
|
||||
else()
|
||||
set(HAVE_BREEZE_DECO FALSE)
|
||||
endif()
|
||||
else()
|
||||
set(HAVE_BREEZE_DECO FALSE)
|
||||
endif()
|
||||
add_feature_info("Breeze-Decoration" HAVE_BREEZE_DECO "Default decoration plugin Breeze")
|
||||
|
||||
find_package(EGL)
|
||||
set_package_properties(EGL PROPERTIES
|
||||
TYPE RUNTIME
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
#cmakedefine01 HAVE_WAYLAND_EGL
|
||||
#cmakedefine01 HAVE_SYS_PRCTL_H
|
||||
#cmakedefine01 HAVE_PR_SET_DUMPABLE
|
||||
#cmakedefine01 HAVE_BREEZE_DECO
|
||||
#if HAVE_BREEZE_DECO
|
||||
#define BREEZE_KDECORATION_PLUGIN_ID "${BREEZE_KDECORATION_PLUGIN_ID}"
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
|
|
|
@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "scene.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include <config-kwin.h>
|
||||
|
||||
// KDecoration
|
||||
#include <KDecoration2/Decoration>
|
||||
|
@ -50,8 +51,13 @@ namespace KWin
|
|||
namespace Decoration
|
||||
{
|
||||
|
||||
static const QString s_aurorae = QStringLiteral("org.kde.kwin.aurorae");
|
||||
static const QString s_pluginName = QStringLiteral("org.kde.kdecoration2");
|
||||
static const QString s_defaultPlugin = QStringLiteral("org.kde.breeze");
|
||||
#if HAVE_BREEZE_DECO
|
||||
static const QString s_defaultPlugin = QStringLiteral(BREEZE_KDECORATION_PLUGIN_ID);
|
||||
#else
|
||||
static const QString s_defaultPlugin = s_aurorae;
|
||||
#endif
|
||||
|
||||
KWIN_SINGLETON_FACTORY(DecorationBridge)
|
||||
|
||||
|
@ -105,7 +111,7 @@ void DecorationBridge::init()
|
|||
}
|
||||
// default plugin failed to load, try fallback
|
||||
if (!m_factory) {
|
||||
m_plugin = QStringLiteral("org.kde.kwin.aurorae");
|
||||
m_plugin = s_aurorae;
|
||||
initPlugin();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "kcm.h"
|
||||
#include "decorationmodel.h"
|
||||
#include "declarative-plugin/buttonsmodel.h"
|
||||
#include <config-kwin.h>
|
||||
|
||||
// KDE
|
||||
#include <KConfigGroup>
|
||||
|
@ -53,7 +54,13 @@ namespace KDecoration2
|
|||
namespace Configuration
|
||||
{
|
||||
static const QString s_pluginName = QStringLiteral("org.kde.kdecoration2");
|
||||
static const QString s_defaultPlugin = QStringLiteral("org.kde.breeze");
|
||||
#if HAVE_BREEZE_DECO
|
||||
static const QString s_defaultPlugin = QStringLiteral(BREEZE_KDECORATION_PLUGIN_ID);
|
||||
static const QString s_defaultTheme;
|
||||
#else
|
||||
static const QString s_defaultPlugin = QStringLiteral("org.kde.kwin.aurorae");
|
||||
static const QString s_defaultTheme = QStringLiteral("kwin4_decoration_qml_plastik");
|
||||
#endif
|
||||
static const QString s_borderSizeNormal = QStringLiteral("Normal");
|
||||
static const QString s_ghnsIcon = QStringLiteral("get-hot-new-stuff");
|
||||
|
||||
|
@ -294,7 +301,7 @@ void ConfigurationModule::load()
|
|||
s_loading = true;
|
||||
const KConfigGroup config = KSharedConfig::openConfig("kwinrc")->group(s_pluginName);
|
||||
const QString plugin = config.readEntry("library", s_defaultPlugin);
|
||||
const QString theme = config.readEntry("theme", QString());
|
||||
const QString theme = config.readEntry("theme", s_defaultTheme);
|
||||
const QModelIndex index = m_proxyModel->mapFromSource(m_model->findDecoration(plugin, theme));
|
||||
if (auto listView = m_quickView->rootObject()->findChild<QQuickItem*>("listView")) {
|
||||
listView->setProperty("currentIndex", index.isValid() ? index.row() : -1);
|
||||
|
|
Loading…
Reference in a new issue