From e1dde6ad10479bbf28dfc56625ccf2915172792b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 28 Apr 2015 19:41:36 +0200 Subject: [PATCH] kde-plasma: update to 5.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove wayland patches for plasma-workspace * reduce x-less hacks and blacklist more recipes plasma-world in when building x-less * use mainline kwayland Signed-off-by: Andreas Müller --- classes/kde-plasma.bbclass | 2 +- recipes-kde/packagegroups/plasma-world.bb | 4 +- .../plasma/tier1/kdecoration/kdecoration.bb | 4 +- .../tier2/kfilemetadata/kfilemetadata.bb | 6 +- recipes-kde/plasma/tier3/baloo/baloo.bb | 6 +- .../files/0001-Initial-Wayland-support.patch | 3794 ----------------- ...-fix-build-for-QT_NO_SESSIONMANAGER.patch} | 0 .../0002-Initial-Wayland-support-II.patch | 55 - ...ath.patch => 0002-align-phonon-path.patch} | 0 .../0003-Initial-Wayland-support-III.patch | 33 - ...patch => 0003-fix-paths-in-startkde.patch} | 0 .../0004-Initial-Wayland-support-IV.patch | 39 - ...ta-qt5-standard-binary-path-to-PATH.patch} | 0 .../0005-Initial-Wayland-support-V.patch | 114 - ...-fix-path-for-start_kdeinit_wrapper.patch} | 0 ..._wayland.cpp-stub-for-non-x11-builds.patch | 40 - ...-for-kwin-only-in-case-X11-was-found.patch | 89 - ...ssionrunner-in-x11-less-environments.patch | 57 - ...e-fix-build-in-X11-less-environments.patch | 44 - .../files/0010-fix-missuse-of-HAVE_X11.patch | 70 - .../plasma-workspace/plasma-workspace.bb | 34 +- recipes-kde/plasma/untier/breeze/breeze.bb | 5 +- .../untier/kde-cli-tools/kde-cli-tools.bb | 4 +- .../untier/kde-gtk-config/kde-gtk-config.bb | 4 +- .../kdeplasma-addons/kdeplasma-addons.bb | 10 +- .../plasma/untier/khelpcenter/khelpcenter.bb | 4 +- .../plasma/untier/khotkeys/khotkeys.bb | 4 +- .../plasma/untier/kinfocenter/kinfocenter.bb | 9 +- .../plasma/untier/kio-extras/kio-extras.bb | 4 +- .../plasma/untier/kmenuedit/kmenuedit.bb | 4 +- recipes-kde/plasma/untier/kscreen/kscreen.bb | 4 +- .../plasma/untier/ksshaskpass/ksshaskpass.bb | 4 +- .../plasma/untier/ksysguard/ksysguard.bb | 4 +- ...dd-pkg-config-as-fallback-for-Waylan.patch | 39 - .../0001-do-not-perform-runtime-tests.patch | 30 + .../plasma/untier/kwayland/kwayland.bb | 19 +- ...or-qtbase-without-session-management.patch | 6 +- ...upport-for-pure-wayland-environments.patch | 148 - recipes-kde/plasma/untier/kwin/kwin.bb | 4 +- recipes-kde/plasma/untier/kwrited/kwrited.bb | 4 +- ...onfiguration-build-on-x-less-systems.patch | 179 +- .../plasma/untier/libkscreen/libkscreen.bb | 4 +- .../untier/libksysguard/libksysguard.bb | 4 +- recipes-kde/plasma/untier/milou/milou.bb | 4 +- recipes-kde/plasma/untier/muon/muon.bb | 5 +- .../untier/oxygen-fonts/oxygen-fonts.bb | 4 +- recipes-kde/plasma/untier/oxygen/oxygen.bb | 5 +- .../files/0001-fix-path-to-fontinst.patch | 4 +- .../untier/plasma-desktop/plasma-desktop.bb | 5 +- ...Adapt-to-modemmanager-qt-API-changes.patch | 81 - .../plasma/untier/plasma-nm/plasma-nm.bb | 5 +- .../plasma-workspace-wallpapers.bb | 4 +- .../polkit-kde-agent-1/polkit-kde-agent-1.bb | 4 +- .../plasma/untier/powerdevil/powerdevil.bb | 4 +- .../plasma/untier/sddm-kcm/sddm-kcm.bb | 4 +- .../untier/systemsettings/systemsettings.bb | 4 +- 56 files changed, 194 insertions(+), 4827 deletions(-) delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0001-Initial-Wayland-support.patch rename recipes-kde/plasma/tier3/plasma-workspace/files/{0011-fix-build-for-QT_NO_SESSIONMANAGER.patch => 0001-fix-build-for-QT_NO_SESSIONMANAGER.patch} (100%) delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0002-Initial-Wayland-support-II.patch rename recipes-kde/plasma/tier3/plasma-workspace/files/{0012-align-phonon-path.patch => 0002-align-phonon-path.patch} (100%) delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0003-Initial-Wayland-support-III.patch rename recipes-kde/plasma/tier3/plasma-workspace/files/{0013-fix-paths-in-startkde.patch => 0003-fix-paths-in-startkde.patch} (100%) delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0004-Initial-Wayland-support-IV.patch rename recipes-kde/plasma/tier3/plasma-workspace/files/{0014-startkde-add-meta-qt5-standard-binary-path-to-PATH.patch => 0004-startkde-add-meta-qt5-standard-binary-path-to-PATH.patch} (100%) delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0005-Initial-Wayland-support-V.patch rename recipes-kde/plasma/tier3/plasma-workspace/files/{0015-startkde-fix-path-for-start_kdeinit_wrapper.patch => 0005-startkde-fix-path-for-start_kdeinit_wrapper.patch} (100%) delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0006-HACK-enable-task_wayland.cpp-stub-for-non-x11-builds.patch delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0007-Do-check-for-kwin-only-in-case-X11-was-found.patch delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0008-Stub-down-sessionrunner-in-x11-less-environments.patch delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0009-dataengines-mouse-fix-build-in-X11-less-environments.patch delete mode 100644 recipes-kde/plasma/tier3/plasma-workspace/files/0010-fix-missuse-of-HAVE_X11.patch delete mode 100644 recipes-kde/plasma/untier/kwayland/files/0001-CMakeLists.txt-add-pkg-config-as-fallback-for-Waylan.patch create mode 100644 recipes-kde/plasma/untier/kwayland/files/0001-do-not-perform-runtime-tests.patch delete mode 100644 recipes-kde/plasma/untier/kwin/files/0002-Add-X11-less-support-for-pure-wayland-environments.patch delete mode 100644 recipes-kde/plasma/untier/plasma-nm/files/0001-Adapt-to-modemmanager-qt-API-changes.patch diff --git a/classes/kde-plasma.bbclass b/classes/kde-plasma.bbclass index 633cbc67..5d1e6b5e 100644 --- a/classes/kde-plasma.bbclass +++ b/classes/kde-plasma.bbclass @@ -1,5 +1,5 @@ inherit kde-base -PLASMA_VERSION = "5.2.2" +PLASMA_VERSION = "5.3.0" SRC_URI = "http://download.kde.org/stable/plasma/${PLASMA_VERSION}/${BPN}-${PV}.tar.xz" diff --git a/recipes-kde/packagegroups/plasma-world.bb b/recipes-kde/packagegroups/plasma-world.bb index fed0f12a..062f7c5e 100644 --- a/recipes-kde/packagegroups/plasma-world.bb +++ b/recipes-kde/packagegroups/plasma-world.bb @@ -14,7 +14,7 @@ TIER_2 = " \ TIER_3 = " \ baloo \ - plasma-workspace \ + ${@bb.utils.contains("DISTRO_FEATURES", "x11", "plasma-workspace", "",d)} \ " UNTIER = " \ @@ -40,7 +40,7 @@ UNTIER = " \ muon \ oxygen \ oxygen-fonts \ - plasma-desktop \ + ${@bb.utils.contains("DISTRO_FEATURES", "x11", "plasma-desktop", "",d)} \ plasma-nm \ plasma-workspace-wallpapers \ polkit-kde-agent-1 \ diff --git a/recipes-kde/plasma/tier1/kdecoration/kdecoration.bb b/recipes-kde/plasma/tier1/kdecoration/kdecoration.bb index eda03e3a..b0910422 100644 --- a/recipes-kde/plasma/tier1/kdecoration/kdecoration.bb +++ b/recipes-kde/plasma/tier1/kdecoration/kdecoration.bb @@ -5,8 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" inherit kde-plasma cmake-lib PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "7c5e26b0f445df5b7447a12b8d54bf45" -SRC_URI[sha256sum] = "3436e907e04ab8d365459252407bf4815d1c74b781937bd3067f87fca9539ba8" +SRC_URI[md5sum] = "ffa130e4015a76889c7dfac44674dc4d" +SRC_URI[sha256sum] = "6df491dcb083b2d86c18c0f1afff51c84ecc21b6705f72d852cfb8ce50c37ca9" # cross libs / headers CMAKE_ALIGN_SYSROOT[1] = "KDecoration2, -S${libdir}/lib, -S${STAGING_LIBDIR}/lib" diff --git a/recipes-kde/plasma/tier2/kfilemetadata/kfilemetadata.bb b/recipes-kde/plasma/tier2/kfilemetadata/kfilemetadata.bb index df4b420c..822d068e 100644 --- a/recipes-kde/plasma/tier2/kfilemetadata/kfilemetadata.bb +++ b/recipes-kde/plasma/tier2/kfilemetadata/kfilemetadata.bb @@ -10,9 +10,9 @@ LIC_FILES_CHKSUM = " \ inherit kde-plasma cmake-lib pkgconfig -PV = "5.6.1" -SRC_URI[md5sum] = "12c57ca501117397edbda63f284dae68" -SRC_URI[sha256sum] = "83d375cef080fd9171b84c37229b8f090e69ae4d05196c7baee472f22cfccd70" +PV = "5.9.0" +SRC_URI[md5sum] = "681f81b14a6e5ea2df5e3d765de30080" +SRC_URI[sha256sum] = "5c92b9edf53de8bb4f5ce7efed9c858cb6726eefd265ac43d8178fa0fd6dec65" DEPENDS += "libav ki18n karchive poppler" diff --git a/recipes-kde/plasma/tier3/baloo/baloo.bb b/recipes-kde/plasma/tier3/baloo/baloo.bb index a8369423..1d671e54 100644 --- a/recipes-kde/plasma/tier3/baloo/baloo.bb +++ b/recipes-kde/plasma/tier3/baloo/baloo.bb @@ -9,9 +9,9 @@ inherit kde-plasma cmake-lib DEPENDS += "ki18n kconfig kidletime kitemmodels kinit kauth kcrash solid kio kdelibs4support kfilemetadata ktexteditor xapian-core" -PV = "5.6.1" -SRC_URI[md5sum] = "df0d96ef85bfe46bceab6fdf796300f8" -SRC_URI[sha256sum] = "c2e1b6bf3c2ad830fde63c863fa1b792272cca2986a5145b490ba63ef116eea9" +PV = "5.9.0" +SRC_URI[md5sum] = "94c020690684290296a80d192989e430" +SRC_URI[sha256sum] = "d64fa65d2d0c2f063a6bc68232a9799709082cf8e10c9473c48c496b7f35d3d8" SRC_URI += "file://0001-fix-build-for-QT_NO_SESSIONMANAGER.patch" diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0001-Initial-Wayland-support.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0001-Initial-Wayland-support.patch deleted file mode 100644 index 7e5a259a..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0001-Initial-Wayland-support.patch +++ /dev/null @@ -1,3794 +0,0 @@ -From 0d22c828b7d8b73a1030e33af2aef21d033859d3 Mon Sep 17 00:00:00 2001 -From: Pier Luigi Fiorini -Date: Sun, 7 Sep 2014 18:01:36 +0200 -Subject: [PATCH 01/12] Initial Wayland support - -Add KF5Wayland check and port a few components. - -Components fully ported with this commit: - - - ksplashqml - - plasmashell - -ksmserver is built only when X11 is found because it's not yet ready -for Wayland and so is the windows runner. - -The remaining components will be ported in future commits. ---- - CMakeLists.txt | 21 +- - kglobalaccel/config-kglobalaccel.h.cmake | 1 + - ksplash/ksplashqml/CMakeLists.txt | 24 ++ - ksplash/ksplashqml/splashapp.cpp | 129 +++++--- - ksplash/ksplashqml/splashapp.h | 17 +- - ksplash/ksplashqml/splashappwayland.cpp | 78 +++++ - ksplash/ksplashqml/splashappwayland_p.h | 47 +++ - ksplash/ksplashqml/splashappx11.cpp | 30 ++ - ksplash/ksplashqml/splashappx11_p.h | 33 ++ - ksplash/ksplashqml/splashapp_p.h | 56 ++++ - ksplash/ksplashqml/config-ksplashqml.h.cmake | 2 + - libkworkspace/config-libkworkspace.h.cmake | 7 +- - libtaskmanager/CMakeLists.txt | 8 +- - libtaskmanager/launcherproperties.cpp | 16 +- - libtaskmanager/task_wayland.cpp | 106 ++++++ - libtaskmanager/taskactions.cpp | 7 +- - runners/CMakeLists.txt | 4 +- - runners/windows/config-windowsrunner.h.cmake | 5 +- - shell/CMakeLists.txt | 33 ++ - shell/config-plasma.h.cmake | 1 + - shell/desktopview.cpp | 67 ++-- - shell/desktopview.h | 3 + - shell/panelshadows.cpp | 429 +------------------------ - shell/panelshadows_p.h | 4 +- - shell/panelview.cpp | 248 ++------------ - shell/panelview.h | 10 + - shell/platform/platformdesktopview.cpp | 43 +++ - shell/platform/platformdesktopview.h | 38 +++ - shell/platform/platformdesktopview_wayland.cpp | 89 +++++ - shell/platform/platformdesktopview_wayland.h | 44 +++ - shell/platform/platformdesktopview_x11.cpp | 72 +++++ - shell/platform/platformdesktopview_x11.h | 33 ++ - shell/platform/platformpanelshadows.cpp | 160 +++++++++ - shell/platform/platformpanelshadows.h | 62 ++++ - shell/platform/platformpanelshadows_x11.cpp | 247 ++++++++++++++ - shell/platform/platformpanelshadows_x11.h | 53 +++ - shell/platform/platformpanelview.cpp | 79 +++++ - shell/platform/platformpanelview.h | 51 +++ - shell/platform/platformpanelview_wayland.cpp | 114 +++++++ - shell/platform/platformpanelview_wayland.h | 47 +++ - shell/platform/platformpanelview_x11.cpp | 284 ++++++++++++++++ - shell/platform/platformpanelview_x11.h | 45 +++ - shell/platform/waylandinterface.cpp | 73 +++++ - shell/platform/waylandinterface.h | 47 +++ - shell/shellmanager.cpp | 12 + - 45 files changed, 2236 insertions(+), 743 deletions(-) - create mode 100644 ksplash/ksplashqml/splashappwayland.cpp - create mode 100644 ksplash/ksplashqml/splashappwayland_p.h - create mode 100644 ksplash/ksplashqml/splashappx11.cpp - create mode 100644 ksplash/ksplashqml/splashappx11_p.h - create mode 100644 ksplash/ksplashqml/splashapp_p.h - create mode 100644 ksplash/ksplashqml/config-ksplashqml.h.cmake - create mode 100644 libtaskmanager/task_wayland.cpp - create mode 100644 shell/platform/platformdesktopview.cpp - create mode 100644 shell/platform/platformdesktopview.h - create mode 100644 shell/platform/platformdesktopview_wayland.cpp - create mode 100644 shell/platform/platformdesktopview_wayland.h - create mode 100644 shell/platform/platformdesktopview_x11.cpp - create mode 100644 shell/platform/platformdesktopview_x11.h - create mode 100644 shell/platform/platformpanelshadows.cpp - create mode 100644 shell/platform/platformpanelshadows.h - create mode 100644 shell/platform/platformpanelshadows_x11.cpp - create mode 100644 shell/platform/platformpanelshadows_x11.h - create mode 100644 shell/platform/platformpanelview.cpp - create mode 100644 shell/platform/platformpanelview.h - create mode 100644 shell/platform/platformpanelview_wayland.cpp - create mode 100644 shell/platform/platformpanelview_wayland.h - create mode 100644 shell/platform/platformpanelview_x11.cpp - create mode 100644 shell/platform/platformpanelview_x11.h - create mode 100644 shell/platform/waylandinterface.cpp - create mode 100644 shell/platform/waylandinterface.h - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 620e250..582b58e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -53,9 +53,9 @@ set_package_properties(dbusmenu-qt5 PROPERTIES DESCRIPTION "Support for notifica - - find_package(X11) - set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" -- URL "http://www.x.org" -- TYPE OPTIONAL -- PURPOSE "Required for building the X11 based workspace") -+ URL "http://www.x.org" -+ TYPE OPTIONAL -+ PURPOSE "Required for building the X11 based workspace") - - if(X11_FOUND) - find_package(XCB MODULE REQUIRED COMPONENTS XCB KEYSYMS) -@@ -71,6 +71,16 @@ if(X11_FOUND AND XCB_XCB_FOUND) - set(HAVE_X11 1) - endif() - -+find_package(KF5Wayland CONFIG REQUIRED COMPONENTS WaylandClient) -+set_package_properties(KF5Wayland PROPERTIES -+ TYPE OPTIONAL -+ PURPOSE "Required for the workspace on Wayland") -+add_feature_info("KF5Wayland" KF5Wayland_FOUND "Required for the workspace on Wayland") -+ -+if(KF5Wayland_FOUND) -+ set(HAVE_WAYLAND 1) -+endif() -+ - include(ConfigureChecks.cmake) - - include_directories("${CMAKE_CURRENT_BINARY_DIR}") -@@ -96,6 +106,7 @@ if (INSTALL_SDDM_THEME) - endif() - - add_subdirectory(doc) -+ - add_subdirectory(libkworkspace) - add_subdirectory(libtaskmanager) - add_subdirectory(components) -@@ -109,7 +120,9 @@ add_subdirectory(shell) - add_subdirectory(freespacenotifier) - add_subdirectory(klipper) - add_subdirectory(krunner) --add_subdirectory(ksmserver) -+if(HAVE_X11) -+ add_subdirectory(ksmserver) -+endif() - add_subdirectory(ksplash) - add_subdirectory(systemmonitor) - add_subdirectory(statusnotifierwatcher) -diff --git a/kglobalaccel/config-kglobalaccel.h.cmake b/kglobalaccel/config-kglobalaccel.h.cmake -index 89858d1..1faeb1f 100644 ---- a/kglobalaccel/config-kglobalaccel.h.cmake -+++ b/kglobalaccel/config-kglobalaccel.h.cmake -@@ -1 +1,2 @@ - #cmakedefine01 HAVE_X11 -+#cmakedefine01 HAVE_WAYLAND -diff --git a/ksplash/ksplashqml/CMakeLists.txt b/ksplash/ksplashqml/CMakeLists.txt -index 16c58a0..59a1a3c 100644 ---- a/ksplash/ksplashqml/CMakeLists.txt -+++ b/ksplash/ksplashqml/CMakeLists.txt -@@ -2,12 +2,32 @@ project(ksplashqml) - - add_subdirectory(themes) - -+if(HAVE_WAYLAND) -+ include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) -+endif() -+ -+configure_file(config-ksplashqml.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksplashqml.h) -+ - set(ksplashqml_SRCS - main.cpp - splashapp.cpp - splashwindow.cpp - ) - -+if(HAVE_X11) -+ set(ksplashqml_SRCS -+ ${ksplashqml_SRCS} -+ splashappx11.cpp -+ ) -+endif() -+ -+if(HAVE_WAYLAND) -+ set(ksplashqml_SRCS -+ ${ksplashqml_SRCS} -+ splashappwayland.cpp -+ ) -+endif() -+ - add_executable(ksplashqml ${ksplashqml_SRCS}) - - target_link_libraries(ksplashqml -@@ -16,6 +36,10 @@ target_link_libraries(ksplashqml - KF5::PlasmaQuick - ) - -+if(HAVE_WAYLAND) -+ target_link_libraries(ksplashqml KF5::WaylandClient) -+endif() -+ - install(TARGETS ksplashqml ${INSTALL_TARGETS_DEFAULT_ARGS}) - install(FILES org.kde.KSplash.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR}) - -diff --git a/ksplash/ksplashqml/splashapp.cpp b/ksplash/ksplashqml/splashapp.cpp -index e68db1b..4e1ba55 100644 ---- a/ksplash/ksplashqml/splashapp.cpp -+++ b/ksplash/ksplashqml/splashapp.cpp -@@ -1,6 +1,7 @@ - /* - * Copyright (C) 2010 Ivan Cukic - * Copyright (C) 2013 Martin Klapetek -+ * Copyright (C) 2014 Pier Luigi Fiorini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, -@@ -20,6 +21,16 @@ - - #include "splashwindow.h" - #include "splashapp.h" -+#include "splashapp_p.h" -+ -+#include "config-ksplashqml.h" -+ -+#if HAVE_X11 -+# include "splashappx11_p.h" -+#endif -+#if HAVE_WAYLAND -+# include "splashappwayland_p.h" -+#endif - - #include - #include -@@ -43,95 +54,133 @@ - * - desktop - */ - --SplashApp::SplashApp(int &argc, char ** argv) -- : QGuiApplication(argc, argv), -- m_stage(0), -- m_testing(false), -- m_window(false), -- m_startTime(QDateTime::currentDateTime()) -+SplashAppPrivate::SplashAppPrivate(SplashApp *q) -+ : stage(0) -+ , testing(false) -+ , window(false) -+ , startTime(QDateTime::currentDateTime()) -+ , q(q) - { -- QCommandLineParser parser; -- parser.addOption(QCommandLineOption("test", "Run in test mode")); -- parser.addOption(QCommandLineOption("window", "Run in windowed mode")); -- parser.addOption(QCommandLineOption("nofork", "Don't fork")); -- parser.addOption(QCommandLineOption("pid", "Print the pid of the child process")); -- parser.addHelpOption(); -+} - -- parser.process(*this); -- m_testing = parser.isSet("test"); -- m_window = parser.isSet("window"); -+SplashAppPrivate::~SplashAppPrivate() -+{ -+ qDeleteAll(windows); -+} - -- foreach(QScreen* screen, screens()) -- adoptScreen(screen); -+void SplashAppPrivate::setup() -+{ -+ foreach(QScreen* screen, q->screens()) -+ q->adoptScreen(screen); - -- setStage("initial"); -+ q->setStage("initial"); - - QPixmap cursor(32, 32); - cursor.fill(Qt::transparent); -- setOverrideCursor(QCursor(cursor)); -+ q->setOverrideCursor(QCursor(cursor)); - -- if (m_testing) { -- m_timer.start(TEST_STEP_INTERVAL, this); -+ if (testing) { -+ timer.start(TEST_STEP_INTERVAL, q); - } - -- connect(this, SIGNAL(screenAdded(QScreen*)), this, SLOT(adoptScreen(QScreen*))); -+ q->connect(q, SIGNAL(screenAdded(QScreen*)), q, SLOT(adoptScreen(QScreen*))); - - QDBusConnection dbus = QDBusConnection::sessionBus(); -- dbus.registerObject(QStringLiteral("/KSplash"), this, QDBusConnection::ExportScriptableSlots); -+ dbus.registerObject(QStringLiteral("/KSplash"), q, QDBusConnection::ExportScriptableSlots); - dbus.registerService(QStringLiteral("org.kde.KSplash")); -+} - -+void SplashAppPrivate::initialize() -+{ - } - --SplashApp::~SplashApp() -+void SplashAppPrivate::setupWindow(SplashWindow *w) - { -- qDeleteAll(m_windows); -+ Q_UNUSED(w); -+} -+ -+void SplashAppPrivate::ready() -+{ -+} -+ -+SplashApp::SplashApp(int &argc, char ** argv) -+ : QGuiApplication(argc, argv) -+ , d() -+{ -+ QCommandLineParser parser; -+ parser.addOption(QCommandLineOption("test", "Run in test mode")); -+ parser.addOption(QCommandLineOption("window", "Run in windowed mode")); -+ parser.addOption(QCommandLineOption("nofork", "Don't fork")); -+ parser.addOption(QCommandLineOption("pid", "Print the pid of the child process")); -+ parser.addHelpOption(); -+ -+#if HAVE_X11 -+ if (d.isNull() && QGuiApplication::platformName() == QStringLiteral("xcb")) { -+ d.reset(new SplashAppX11(this)); -+ } -+#endif -+#if HAVE_WAYLAND -+ if (d.isNull() && QGuiApplication::platformName().startsWith(QStringLiteral("wayland"))) { -+ d.reset(new SplashAppWayland(this)); -+ } -+#endif -+ -+ parser.process(*this); -+ d->testing = parser.isSet("test"); -+ d->window = parser.isSet("window"); -+ -+ d->initialize(); - } - - void SplashApp::timerEvent(QTimerEvent * event) - { -- if (event->timerId() == m_timer.timerId()) { -- m_timer.stop(); -+ if (event->timerId() == d->timer.timerId()) { -+ d->timer.stop(); - -- setStage(m_stage + 1); -+ setStage(d->stage + 1); - -- m_timer.start(TEST_STEP_INTERVAL, this); -+ d->timer.start(TEST_STEP_INTERVAL, this); - } - } - - void SplashApp::setStage(const QString &stage) - { -- qDebug() << "Loading stage " << stage << m_startTime.msecsTo(QDateTime::currentDateTime()); -+ qDebug() << "Loading stage " << stage << d->startTime.msecsTo(QDateTime::currentDateTime()); - -- if (m_stages.contains(stage)) { -+ if (d->stages.contains(stage)) { -+ d->ready(); - return; - } -- m_stages.append(stage); -- setStage(m_stages.count()); -+ d->stages.append(stage); -+ setStage(d->stages.count()); - } - - void SplashApp::setStage(int stage) - { -- if (m_stage == 7) { -+ if (d->stage == 7) { -+ d->ready(); - QGuiApplication::exit(EXIT_SUCCESS); - } - -- m_stage = stage; -- foreach (SplashWindow *w, m_windows) { -+ d->stage = stage; -+ foreach (SplashWindow *w, d->windows) { - w->setStage(stage); - } - } - - void SplashApp::adoptScreen(QScreen* screen) - { -- SplashWindow *w = new SplashWindow(m_testing, m_window); -+ SplashWindow *w = new SplashWindow(d->testing, d->window); -+ w->setScreen(screen); -+ d->setupWindow(w); - w->setGeometry(screen->availableGeometry()); -- w->setStage(m_stage); -+ w->setStage(d->stage); - w->show(); -- m_windows << w; -+ d->windows << w; - - connect(screen, &QScreen::geometryChanged, w, &SplashWindow::setGeometry); - connect(screen, &QObject::destroyed, w, [this, w](){ -- m_windows.removeAll(w); -+ d->windows.removeAll(w); - w->deleteLater(); - }); - } -diff --git a/ksplash/ksplashqml/splashapp.h b/ksplash/ksplashqml/splashapp.h -index 1be9d0b..86d86c7 100644 ---- a/ksplash/ksplashqml/splashapp.h -+++ b/ksplash/ksplashqml/splashapp.h -@@ -1,6 +1,7 @@ - /* - * Copyright (C) 2010 Ivan Cukic - * Copyright (C) 2013 Martin Klapetek -+ * Copyright (C) 2014 Pier Luigi Fiorini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, -@@ -23,10 +24,9 @@ - - #include - #include --#include --#include -+#include "splashapp_p.h" - --class SplashWindow; -+class SplashAppPrivate; - - class SplashApp: public QGuiApplication - { -@@ -35,7 +35,6 @@ class SplashApp: public QGuiApplication - - public: - explicit SplashApp(int &argc, char ** argv); -- virtual ~SplashApp(); - - public Q_SLOTS: - Q_SCRIPTABLE void setStage(const QString &messgae); -@@ -45,13 +44,9 @@ protected: - void setStage(int stage); - - private: -- int m_stage; -- QList m_windows; -- bool m_testing; -- bool m_window; -- QStringList m_stages; -- QBasicTimer m_timer; -- QDateTime m_startTime; -+ QScopedPointer d; -+ -+ friend class SplashAppPrivate; - - private Q_SLOTS: - void adoptScreen(QScreen*); -diff --git a/ksplash/ksplashqml/splashappwayland.cpp b/ksplash/ksplashqml/splashappwayland.cpp -new file mode 100644 -index 0000000..aa21b8f ---- /dev/null -+++ b/ksplash/ksplashqml/splashappwayland.cpp -@@ -0,0 +1,78 @@ -+/* -+ * Copyright (C) 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2, -+ * or (at your option) any later version, as published by the Free -+ * Software Foundation -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details -+ * -+ * You should have received a copy of the GNU General Public -+ * License along with this program; if not, write to the -+ * Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "splashapp.h" -+#include "splashappwayland_p.h" -+#include "splashwindow.h" -+ -+#include -+#include -+ -+#include -+#include -+#include -+ -+using namespace KWayland::Client; -+ -+SplashAppWayland::SplashAppWayland(SplashApp *q) -+ : QObject(q) -+ , SplashAppPrivate(q) -+ , m_plasmaShell(Q_NULLPTR) -+{ -+} -+ -+void SplashAppWayland::initialize() -+{ -+ // Reuse QPA connection to Wayland instead of ConnectionThread, otherwise -+ // wl_surface objects from the native interface won't be recognized by -+ // the compositor -+ // TODO: Add a static method to ConnectionThread to create it using -+ // wl_display from the native interface -+ QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); -+ wl_display *display = static_cast( -+ native->nativeResourceForIntegration("display")); -+ -+ Registry *registry = new Registry(this); -+ connect(registry, &Registry::plasmaShellAnnounced, this, -+ [this, registry](quint32 name, quint32 version) { -+ m_plasmaShell = registry->createPlasmaShell(name, version, registry); -+ setup(); -+ } -+ ); -+ registry->create(display); -+ registry->setup(); -+} -+ -+void SplashAppWayland::setupWindow(SplashWindow *w) -+{ -+ if (m_plasmaShell && !window) { -+ KWayland::Client::PlasmaSurface *plasmaSurface = m_plasmaShell->createSurface(w, this); -+ plasmaSurface->setRole(KWayland::Client::PlasmaSurface::Role::Splash); -+ plasmaSurface->setOutput(w->screen()); -+ } -+} -+ -+void SplashAppWayland::ready() -+{ -+ // Tell the compositor we are ready -+ if (m_plasmaShell) -+ m_plasmaShell->desktopReady(); -+} -+ -+#include "splashappwayland.moc" -diff --git a/ksplash/ksplashqml/splashappwayland_p.h b/ksplash/ksplashqml/splashappwayland_p.h -new file mode 100644 -index 0000000..24d9df8 ---- /dev/null -+++ b/ksplash/ksplashqml/splashappwayland_p.h -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (C) 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2, -+ * or (at your option) any later version, as published by the Free -+ * Software Foundation -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details -+ * -+ * You should have received a copy of the GNU General Public -+ * License along with this program; if not, write to the -+ * Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef SPLASH_APP_WAYLAND_P_H -+#define SPLASH_APP_WAYLAND_P_H -+ -+#include -+ -+#include "splashapp_p.h" -+ -+namespace KWayland { -+ namespace Client { -+ class PlasmaShell; -+ } -+} -+ -+class SplashAppWayland : public QObject, public SplashAppPrivate -+{ -+ Q_OBJECT -+public: -+ SplashAppWayland(SplashApp *q); -+ -+ void initialize(); -+ void setupWindow(SplashWindow *w); -+ void ready(); -+ -+private: -+ KWayland::Client::PlasmaShell *m_plasmaShell; -+}; -+ -+#endif // SPLASH_APP_WAYLAND_P_H -diff --git a/ksplash/ksplashqml/splashappx11.cpp b/ksplash/ksplashqml/splashappx11.cpp -new file mode 100644 -index 0000000..3464eb3 ---- /dev/null -+++ b/ksplash/ksplashqml/splashappx11.cpp -@@ -0,0 +1,30 @@ -+/* -+ * Copyright (C) 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2, -+ * or (at your option) any later version, as published by the Free -+ * Software Foundation -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details -+ * -+ * You should have received a copy of the GNU General Public -+ * License along with this program; if not, write to the -+ * Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "splashappx11_p.h" -+ -+SplashAppX11::SplashAppX11(SplashApp *q) -+ : SplashAppPrivate(q) -+{ -+} -+ -+void SplashAppX11::initialize() -+{ -+ setup(); -+} -diff --git a/ksplash/ksplashqml/splashappx11_p.h b/ksplash/ksplashqml/splashappx11_p.h -new file mode 100644 -index 0000000..4812082 ---- /dev/null -+++ b/ksplash/ksplashqml/splashappx11_p.h -@@ -0,0 +1,33 @@ -+/* -+ * Copyright (C) 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2, -+ * or (at your option) any later version, as published by the Free -+ * Software Foundation -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details -+ * -+ * You should have received a copy of the GNU General Public -+ * License along with this program; if not, write to the -+ * Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef SPLASH_APP_X11_P_H -+#define SPLASH_APP_X11_P_H -+ -+#include "splashapp_p.h" -+ -+class SplashAppX11 : public SplashAppPrivate -+{ -+public: -+ SplashAppX11(SplashApp *q); -+ -+ void initialize(); -+}; -+ -+#endif // SPLASH_APP_X11_P_H -diff --git a/ksplash/ksplashqml/splashapp_p.h b/ksplash/ksplashqml/splashapp_p.h -new file mode 100644 -index 0000000..c4a46a3 ---- /dev/null -+++ b/ksplash/ksplashqml/splashapp_p.h -@@ -0,0 +1,56 @@ -+/* -+ * Copyright (C) 2010 Ivan Cukic -+ * Copyright (C) 2013 Martin Klapetek -+ * Copyright (C) 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2, -+ * or (at your option) any later version, as published by the Free -+ * Software Foundation -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details -+ * -+ * You should have received a copy of the GNU General Public -+ * License along with this program; if not, write to the -+ * Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef SPLASH_APP_P_H -+#define SPLASH_APP_P_H -+ -+#include -+#include -+#include -+ -+class SplashApp; -+class SplashWindow; -+ -+class SplashAppPrivate -+{ -+public: -+ SplashAppPrivate(SplashApp *q); -+ virtual ~SplashAppPrivate(); -+ -+ void setup(); -+ -+ virtual void initialize(); -+ virtual void setupWindow(SplashWindow *w); -+ virtual void ready(); -+ -+ int stage; -+ QList windows; -+ bool testing; -+ bool window; -+ QStringList stages; -+ QBasicTimer timer; -+ QDateTime startTime; -+ -+protected: -+ SplashApp *q; -+}; -+ -+#endif // SPLASH_APP_H -diff --git a/ksplash/ksplashqml/config-ksplashqml.h.cmake b/ksplash/ksplashqml/config-ksplashqml.h.cmake -new file mode 100644 -index 0000000..1faeb1f ---- /dev/null -+++ b/ksplash/ksplashqml/config-ksplashqml.h.cmake -@@ -0,0 +1,2 @@ -+#cmakedefine01 HAVE_X11 -+#cmakedefine01 HAVE_WAYLAND -diff --git a/libkworkspace/config-libkworkspace.h.cmake b/libkworkspace/config-libkworkspace.h.cmake -index d3d962f..aa9df64 100644 ---- a/libkworkspace/config-libkworkspace.h.cmake -+++ b/libkworkspace/config-libkworkspace.h.cmake -@@ -1,2 +1,5 @@ --/* Define if you have X11 at all */ --#define HAVE_X11 ${X11_FOUND} -\ No newline at end of file -+/* Define to 1 when we build for X11 */ -+#cmakedefine01 HAVE_X11 -+ -+/* Define to 1 when we build for Wayland */ -+#cmakedefine01 HAVE_WAYLAND -diff --git a/libtaskmanager/CMakeLists.txt b/libtaskmanager/CMakeLists.txt -index 92d0020..640f1fb 100644 ---- a/libtaskmanager/CMakeLists.txt -+++ b/libtaskmanager/CMakeLists.txt -@@ -33,9 +33,13 @@ ki18n_wrap_ui(taskmanager_LIB_SRCS launcherconfig.ui launcherproperties.ui) - - if(WIN32) - set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_win.cpp) --else() -+endif() -+if(HAVE_X11 AND NOT WIN32) - set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_x11.cpp) - endif() -+#if(HAVE_WAYLAND) -+# set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_wayland.cpp) -+#endif() - - add_library(taskmanager ${taskmanager_LIB_SRCS}) - add_library(PW::LibTaskManager ALIAS taskmanager) -@@ -57,7 +61,7 @@ target_link_libraries(taskmanager - KF5::KIOWidgets # KRun - KF5::Service - ) --if (X11_FOUND) -+if (HAVE_X11) - target_link_libraries(taskmanager PRIVATE ${Qt5X11Extras_LIBRARIES} ${X11_LIBRARIES}) - if (X11_Xfixes_FOUND) - target_link_libraries(taskmanager PRIVATE ${X11_Xfixes_LIB}) -diff --git a/libtaskmanager/launcherproperties.cpp b/libtaskmanager/launcherproperties.cpp -index 3382913..4a00be4 100644 ---- a/libtaskmanager/launcherproperties.cpp -+++ b/libtaskmanager/launcherproperties.cpp -@@ -28,12 +28,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include - #include - -+#include -+ - #include --#include --#include --#include --#include --#include -+#if HAVE_X11 -+# include -+# include -+# include -+# include -+# include -+#endif - #include - - namespace TaskManager -@@ -174,6 +178,7 @@ bool LauncherProperties::eventFilter(QObject *o, QEvent *e) - - WId LauncherProperties::findWindow() - { -+#if HAVE_X11 - Window root; - Window child; - uint mask; -@@ -197,6 +202,7 @@ WId LauncherProperties::findWindow() - } - parent = child; - } -+#endif - - return 0; - } -diff --git a/libtaskmanager/task_wayland.cpp b/libtaskmanager/task_wayland.cpp -new file mode 100644 -index 0000000..3ea3e0b ---- /dev/null -+++ b/libtaskmanager/task_wayland.cpp -@@ -0,0 +1,106 @@ -+/***************************************************************** -+ -+Copyright (c) 2004 Pier Luigi Fiorini -+ -+Permission is hereby granted, free of charge, to any person obtaining a copy -+of this software and associated documentation files (the "Software"), to deal -+in the Software without restriction, including without limitation the rights -+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+copies of the Software, and to permit persons to whom the Software is -+furnished to do so, subject to the following conditions: -+ -+The above copyright notice and this permission notice shall be included in -+all copies or substantial portions of the Software. -+ -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ -+******************************************************************/ -+ -+#include "task_p.h" -+ -+namespace TaskManager -+{ -+ -+bool Task::updateDemandsAttentionState(WId w) -+{ -+ Q_UNUSED(w); -+ return false; -+} -+ -+QString Task::className() const -+{ -+ return QString(); -+} -+ -+QString Task::classClass() const -+{ -+ return QString(); -+} -+ -+int Task::pid() const -+{ -+ return 0; -+} -+ -+void Task::move() -+{ -+} -+ -+void Task::resize() -+{ -+} -+ -+void Task::setMaximized(bool maximize) -+{ -+ Q_UNUSED(maximize); -+} -+ -+void Task::restore() -+{ -+} -+ -+void Task::close() -+{ -+} -+ -+void Task::toDesktop(int desk) -+{ -+ Q_UNUSED(desk); -+} -+ -+void Task::setAlwaysOnTop(bool stay) -+{ -+ Q_UNUSED(stay); -+} -+ -+void Task::setKeptBelowOthers(bool below) -+{ -+ Q_UNUSED(below); -+} -+ -+void Task::setFullScreen(bool fullscreen) -+{ -+ Q_UNUSED(fullscreen); -+} -+ -+void Task::setShaded(bool shade) -+{ -+ Q_UNUSED(shade); -+} -+ -+void Task::publishIconGeometry(QRect rect) -+{ -+ Q_UNUSED(rect); -+} -+ -+void Task::refreshActivities() -+{ -+ return; -+} -+ -+} // TaskManager namespace -diff --git a/libtaskmanager/taskactions.cpp b/libtaskmanager/taskactions.cpp -index 341fc0f..8bdfa94 100644 ---- a/libtaskmanager/taskactions.cpp -+++ b/libtaskmanager/taskactions.cpp -@@ -43,7 +43,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include - #include - #include --#include -+ -+#if HAVE_X11 -+# include -+#endif - - /////////////////////////////////////////////////////////////////////////////// - // NOTE: if you change the menu, keep kde-workspace/kwin/useractions.cpp in sync -@@ -303,6 +306,7 @@ ToNewDesktopActionImpl::ToNewDesktopActionImpl(QObject *parent, AbstractGroupabl - - void ToNewDesktopActionImpl::slotToNewDesktop() - { -+#if HAVE_X11 - NETRootInfo info(QX11Info::connection(), NET::NumberOfDesktops); - info.setNumberOfDesktops(m_newDesktop); - -@@ -311,6 +315,7 @@ void ToNewDesktopActionImpl::slotToNewDesktop() - task.data()->toDesktop(m_newDesktop); - } - } -+#endif - } - - DesktopsMenu::DesktopsMenu(QWidget *parent, AbstractGroupableItem *item) -diff --git a/runners/CMakeLists.txt b/runners/CMakeLists.txt -index 48cc379..fb52453 100644 ---- a/runners/CMakeLists.txt -+++ b/runners/CMakeLists.txt -@@ -14,7 +14,9 @@ add_subdirectory(windowedwidgets) - if(NOT WIN32) - add_subdirectory(powerdevil) - add_subdirectory(sessions) -- add_subdirectory(windows) -+ if(HAVE_X11) -+ add_subdirectory(windows) -+ endif() - add_subdirectory(kill) - endif() - # -diff --git a/runners/windows/config-windowsrunner.h.cmake b/runners/windows/config-windowsrunner.h.cmake -index d3d962f..f53972b 100644 ---- a/runners/windows/config-windowsrunner.h.cmake -+++ b/runners/windows/config-windowsrunner.h.cmake -@@ -1,2 +1,5 @@ - /* Define if you have X11 at all */ --#define HAVE_X11 ${X11_FOUND} -\ No newline at end of file -+#define HAVE_X11 ${X11_FOUND} -+ -+/* Define if you have Wayland at all */ -+#define HAVE_WAYLAND ${WAYLAND_FOUND} -diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt -index cb48ab8..ef26f78 100644 ---- a/shell/CMakeLists.txt -+++ b/shell/CMakeLists.txt -@@ -24,6 +24,10 @@ configure_file(config-ktexteditor.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kte - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-plasma.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-plasma.h) - -+if(KF5Wayland_FOUND) -+ include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) -+endif() -+ - set(scripting_SRC - scripting/appinterface.cpp - scripting/applet.cpp -@@ -36,6 +40,30 @@ set(scripting_SRC - scripting/widget.cpp - ) - -+set(platform_SRC -+ platform/platformdesktopview.cpp -+ platform/platformpanelview.cpp -+ platform/platformpanelshadows.cpp -+) -+ -+if(HAVE_X11) -+ set(platform_SRC -+ ${platform_SRC} -+ platform/platformdesktopview_x11.cpp -+ platform/platformpanelview_x11.cpp -+ platform/platformpanelshadows_x11.cpp -+ ) -+endif() -+ -+if(HAVE_WAYLAND) -+ set(platform_SRC -+ ${platform_SRC} -+ platform/platformdesktopview_wayland.cpp -+ platform/platformpanelview_wayland.cpp -+ platform/waylandinterface.cpp -+ ) -+endif() -+ - set(plasmashell_dbusXML dbus/org.kde.PlasmaShell.xml) - qt5_add_dbus_adaptor(scripting_SRC ${plasmashell_dbusXML} shellcorona.h ShellCorona plasmashelladaptor) - -@@ -55,6 +83,7 @@ set (plasma_shell_SRCS - standaloneappcorona - osd.cpp - ${scripting_SRC} -+ ${platform_SRC} - ) - - set(krunner_xml ${plasma-workspace_SOURCE_DIR}/krunner/dbus/org.kde.krunner.App.xml) -@@ -92,6 +121,10 @@ if(HAVE_X11) - target_link_libraries(plasmashell Qt5::X11Extras) - endif() - -+if(HAVE_WAYLAND) -+ target_link_libraries(plasmashell KF5::WaylandClient) -+endif() -+ - install(TARGETS plasmashell ${INSTALL_TARGETS_DEFAULT_ARGS}) - install(FILES plasmashell.desktop DESTINATION ${AUTOSTART_INSTALL_DIR}) - install( FILES dbus/org.kde.PlasmaShell.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} ) -diff --git a/shell/config-plasma.h.cmake b/shell/config-plasma.h.cmake -index 1d59ae3..5959e0c 100644 ---- a/shell/config-plasma.h.cmake -+++ b/shell/config-plasma.h.cmake -@@ -2,5 +2,6 @@ - #cmakedefine01 PLASMA_NO_KIO - #cmakedefine01 PLASMA_NO_KUTILS - #cmakedefine01 HAVE_X11 -+#cmakedefine01 HAVE_WAYLAND - #cmakedefine01 HAVE_GLX - #cmakedefine01 HAVE_EGL -diff --git a/shell/desktopview.cpp b/shell/desktopview.cpp -index ac50aed..270586f 100644 ---- a/shell/desktopview.cpp -+++ b/shell/desktopview.cpp -@@ -1,4 +1,5 @@ - /* -+ * Copyright 2014 Pier Luigi Fiorini - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify -@@ -17,11 +18,19 @@ - */ - - #include "desktopview.h" -+#include "config-plasma.h" - #include "containmentconfigview.h" - #include "shellcorona.h" - #include "shellmanager.h" - #include "krunner_interface.h" - -+#if HAVE_X11 -+# include "platform/platformdesktopview_x11.h" -+#endif -+#if HAVE_WAYLAND -+# include "platform/platformdesktopview_wayland.h" -+#endif -+ - #include - #include - #include -@@ -37,8 +46,19 @@ DesktopView::DesktopView(Plasma::Corona *corona, QScreen *targetScreen) - m_dashboardShown(false), - m_windowType(Desktop) - { -+#if HAVE_X11 -+ if (m_impl.isNull() && QGuiApplication::platformName() == QStringLiteral("xcb")) { -+ m_impl.reset(new PlatformDesktopViewX11(this)); -+ } -+#endif -+#if HAVE_WAYLAND -+ if (m_impl.isNull() && QGuiApplication::platformName().startsWith(QStringLiteral("wayland"))) { -+ m_impl.reset(new PlatformDesktopViewWayland(this)); -+ } -+#endif -+ - if (targetScreen) { -- setScreen(targetScreen); -+ m_impl->setScreen(targetScreen); - } - - setTitle(corona->package().metadata().name()); -@@ -97,6 +117,8 @@ void DesktopView::adaptToScreen() - } - - m_oldScreen = screen(); -+ -+ m_impl->setScreen(m_oldScreen); - } - - DesktopView::WindowType DesktopView::windowType() const -@@ -125,51 +147,12 @@ void DesktopView::ensureWindowType() - return; - } - -- if (m_windowType == Window || ShellManager::s_forceWindowed) { -- setFlags(Qt::Window); -- KWindowSystem::setType(winId(), NET::Normal); -- KWindowSystem::clearState(winId(), NET::FullScreen); -- -- } else if (m_windowType == Desktop) { -- setFlags(Qt::Window); -- KWindowSystem::setType(winId(), NET::Desktop); -- KWindowSystem::setState(winId(), NET::KeepBelow); -- -- } else if (m_windowType == WindowedDesktop) { -- KWindowSystem::setType(winId(), NET::Normal); -- KWindowSystem::clearState(winId(), NET::FullScreen); -- setFlags(Qt::FramelessWindowHint | flags()); -- -- } else if (m_windowType == FullScreen) { -- setFlags(Qt::Window); -- KWindowSystem::setType(winId(), NET::Normal); -- KWindowSystem::setState(winId(), NET::FullScreen); -- } -+ m_impl->setWindowType(m_windowType); - } - - void DesktopView::setDashboardShown(bool shown) - { -- if (shown) { -- if (m_windowType == Desktop) { -- KWindowSystem::setType(winId(), NET::Normal); -- KWindowSystem::clearState(winId(), NET::KeepBelow); -- KWindowSystem::setState(winId(), NET::SkipTaskbar|NET::SkipPager); -- } -- setFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint); -- -- raise(); -- KWindowSystem::raiseWindow(winId()); -- KWindowSystem::forceActiveWindow(winId()); -- -- } else { -- if (m_windowType == Desktop) { -- KWindowSystem::setType(winId(), NET::Desktop); -- KWindowSystem::setState(winId(), NET::SkipTaskbar|NET::SkipPager|NET::KeepBelow); -- } -- lower(); -- KWindowSystem::lowerWindow(winId()); -- -- } -+ m_impl->setDashboardShown(shown); - - m_dashboardShown = shown; - emit dashboardShownChanged(); -diff --git a/shell/desktopview.h b/shell/desktopview.h -index 1b07261..480af49 100644 ---- a/shell/desktopview.h -+++ b/shell/desktopview.h -@@ -1,4 +1,5 @@ - /* -+ * Copyright 2014 Pier Luigi Fiorini - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify -@@ -24,6 +25,7 @@ - #include "panelconfigview.h" - #include - -+class PlatformDesktopView; - - class DesktopView : public PlasmaQuick::View - { -@@ -78,6 +80,7 @@ private: - QPointer m_oldScreen; - bool m_dashboardShown : 1; - WindowType m_windowType; -+ QScopedPointer m_impl; - }; - - #endif // DESKTOVIEW_H -diff --git a/shell/panelshadows.cpp b/shell/panelshadows.cpp -index c97564a..b4928ee 100644 ---- a/shell/panelshadows.cpp -+++ b/shell/panelshadows.cpp -@@ -18,77 +18,18 @@ - - #include "panelshadows_p.h" - --#include - #include - - #include - - #if HAVE_X11 --#include --#include --#include --#include --#include -+# include "platform/platformpanelshadows_x11.h" -+#else -+# include "platform/platformpanelshadows.h" - #endif - - #include - --class PanelShadows::Private --{ --public: -- Private(PanelShadows *shadows) -- : q(shadows) --#if HAVE_X11 -- ,_connection( 0x0 ), -- _gc( 0x0 ) -- , m_isX11(QX11Info::isPlatformX11()) --#endif -- { -- } -- -- ~Private() -- { -- // Do not call clearPixmaps() from here: it creates new QPixmap(), -- // which causes a crash when application is stopping. -- freeX11Pixmaps(); -- } -- -- void freeX11Pixmaps(); -- void clearPixmaps(); -- void setupPixmaps(); -- Qt::HANDLE createPixmap(const QPixmap& source); -- void initPixmap(const QString &element); -- QPixmap initEmptyPixmap(const QSize &size); -- void updateShadow(const QWindow *window, Plasma::FrameSvg::EnabledBorders); -- void clearShadow(const QWindow *window); -- void updateShadows(); -- void windowDestroyed(QObject *deletedObject); -- void setupData(Plasma::FrameSvg::EnabledBorders enabledBorders); -- -- PanelShadows *q; -- QList m_shadowPixmaps; -- -- QPixmap m_emptyCornerPix; -- QPixmap m_emptyCornerLeftPix; -- QPixmap m_emptyCornerTopPix; -- QPixmap m_emptyCornerRightPix; -- QPixmap m_emptyCornerBottomPix; -- QPixmap m_emptyVerticalPix; -- QPixmap m_emptyHorizontalPix; -- --#if HAVE_X11 -- //! xcb connection -- xcb_connection_t* _connection; -- -- //! graphical context -- xcb_gcontext_t _gc; -- bool m_isX11; --#endif -- -- QHash > data; -- QHash m_windows; --}; -- - class DialogShadowsSingleton - { - public: -@@ -103,8 +44,18 @@ Q_GLOBAL_STATIC(DialogShadowsSingleton, privateDialogShadowsSelf) - - PanelShadows::PanelShadows(QObject *parent, const QString &prefix) - : Plasma::Svg(parent), -- d(new Private(this)) -+ d(Q_NULLPTR) - { -+#if HAVE_X11 -+ if (QGuiApplication::platformName() == QStringLiteral("xcb")) { -+ d = new PlatformPanelShadowsX11(this); -+ } -+#endif -+ -+ if (!d) { -+ d = new PlatformPanelShadows(this); -+ } -+ - setImagePath(prefix); - connect(this, SIGNAL(repaintNeeded()), this, SLOT(updateShadows())); - } -@@ -146,358 +97,6 @@ void PanelShadows::removeWindow(const QWindow *window) - } - } - --void PanelShadows::Private::windowDestroyed(QObject *deletedObject) --{ -- m_windows.remove(static_cast(deletedObject)); -- -- if (m_windows.isEmpty()) { -- clearPixmaps(); -- } --} -- --void PanelShadows::Private::updateShadows() --{ -- setupPixmaps(); -- QHash::const_iterator i; -- for (i = m_windows.constBegin(); i != m_windows.constEnd(); ++i) { -- updateShadow(i.key(), i.value()); -- } --} -- --Qt::HANDLE PanelShadows::Private::createPixmap(const QPixmap& source) --{ -- -- // do nothing for invalid pixmaps -- if( source.isNull() ) return 0; -- -- /* -- in some cases, pixmap handle is invalid. This is the case notably -- when Qt uses to RasterEngine. In this case, we create an X11 Pixmap -- explicitly and draw the source pixmap on it. -- */ -- -- #if HAVE_X11 -- if (!m_isX11) { -- return 0; -- } -- -- // check connection -- if( !_connection ) _connection = QX11Info::connection(); -- -- const int width( source.width() ); -- const int height( source.height() ); -- -- // create X11 pixmap -- Pixmap pixmap = XCreatePixmap( QX11Info::display(), QX11Info::appRootWindow(), width, height, 32 ); -- -- // check gc -- if( !_gc ) -- { -- _gc = xcb_generate_id( _connection ); -- xcb_create_gc( _connection, _gc, pixmap, 0, 0x0 ); -- } -- --// // create explicitly shared QPixmap from it --// QPixmap dest( QPixmap::fromX11Pixmap( pixmap, QPixmap::ExplicitlyShared ) ); --// --// // create surface for pixmap --// { --// QPainter painter( &dest ); --// painter.setCompositionMode( QPainter::CompositionMode_Source ); --// painter.drawPixmap( 0, 0, source ); --// } --// --// --// return pixmap; -- QImage image( source.toImage() ); -- xcb_put_image( -- _connection, XCB_IMAGE_FORMAT_Z_PIXMAP, pixmap, _gc, -- image.width(), image.height(), 0, 0, -- 0, 32, -- image.byteCount(), image.constBits()); -- -- return (Qt::HANDLE)pixmap; -- -- #else -- return 0; -- #endif -- --} -- --void PanelShadows::Private::initPixmap(const QString &element) --{ -- m_shadowPixmaps << q->pixmap(element); --} -- --QPixmap PanelShadows::Private::initEmptyPixmap(const QSize &size) --{ --#if HAVE_X11 -- if (!m_isX11) { -- return QPixmap(); -- } -- QPixmap tempEmptyPix(size); -- if (!size.isEmpty()) { -- tempEmptyPix.fill(Qt::transparent); -- } -- return tempEmptyPix; --#else -- Q_UNUSED(size) -- return QPixmap(); --#endif --} -- --void PanelShadows::Private::setupPixmaps() --{ -- clearPixmaps(); -- initPixmap("shadow-top"); -- initPixmap("shadow-topright"); -- initPixmap("shadow-right"); -- initPixmap("shadow-bottomright"); -- initPixmap("shadow-bottom"); -- initPixmap("shadow-bottomleft"); -- initPixmap("shadow-left"); -- initPixmap("shadow-topleft"); -- -- m_emptyCornerPix = initEmptyPixmap(QSize(1,1)); -- m_emptyCornerLeftPix = initEmptyPixmap(QSize(q->elementSize("shadow-topleft").width(), 1)); -- m_emptyCornerTopPix = initEmptyPixmap(QSize(1, q->elementSize("shadow-topleft").height())); -- m_emptyCornerRightPix = initEmptyPixmap(QSize(q->elementSize("shadow-bottomright").width(), 1)); -- m_emptyCornerBottomPix = initEmptyPixmap(QSize(1, q->elementSize("shadow-bottomright").height())); -- m_emptyVerticalPix = initEmptyPixmap(QSize(1, q->elementSize("shadow-left").height())); -- m_emptyHorizontalPix = initEmptyPixmap(QSize(q->elementSize("shadow-top").width(), 1)); -- --} -- -- --void PanelShadows::Private::setupData(Plasma::FrameSvg::EnabledBorders enabledBorders) --{ --#if HAVE_X11 -- if (!m_isX11) { -- return; -- } -- //shadow-top -- if (enabledBorders & Plasma::FrameSvg::TopBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[0])); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyHorizontalPix)); -- } -- -- //shadow-topright -- if (enabledBorders & Plasma::FrameSvg::TopBorder && -- enabledBorders & Plasma::FrameSvg::RightBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[1])); -- } else if (enabledBorders & Plasma::FrameSvg::TopBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerTopPix)); -- } else if (enabledBorders & Plasma::FrameSvg::RightBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerRightPix)); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -- } -- -- //shadow-right -- if (enabledBorders & Plasma::FrameSvg::RightBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[2])); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyVerticalPix)); -- } -- -- //shadow-bottomright -- if (enabledBorders & Plasma::FrameSvg::BottomBorder && -- enabledBorders & Plasma::FrameSvg::RightBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[3])); -- } else if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerBottomPix)); -- } else if (enabledBorders & Plasma::FrameSvg::RightBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerRightPix)); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -- } -- -- //shadow-bottom -- if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[4])); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyHorizontalPix)); -- } -- -- //shadow-bottomleft -- if (enabledBorders & Plasma::FrameSvg::BottomBorder && -- enabledBorders & Plasma::FrameSvg::LeftBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[5])); -- } else if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerBottomPix)); -- } else if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerLeftPix)); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -- } -- -- //shadow-left -- if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[6])); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyVerticalPix)); -- } -- -- //shadow-topleft -- if (enabledBorders & Plasma::FrameSvg::TopBorder && -- enabledBorders & Plasma::FrameSvg::LeftBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[7])); -- } else if (enabledBorders & Plasma::FrameSvg::TopBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerTopPix)); -- } else if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerLeftPix)); -- } else { -- data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -- } --#endif -- -- int left, top, right, bottom = 0; -- -- QSize marginHint; -- if (enabledBorders & Plasma::FrameSvg::TopBorder) { -- marginHint = q->elementSize("shadow-hint-top-margin"); -- if (marginHint.isValid()) { -- top = marginHint.height(); -- } else { -- top = m_shadowPixmaps[0].height(); // top -- } -- } else { -- top = 1; -- } -- -- if (enabledBorders & Plasma::FrameSvg::RightBorder) { -- marginHint = q->elementSize("shadow-hint-right-margin"); -- if (marginHint.isValid()) { -- right = marginHint.width(); -- } else { -- right = m_shadowPixmaps[2].width(); // right -- } -- } else { -- right = 1; -- } -- -- if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -- marginHint = q->elementSize("shadow-hint-bottom-margin"); -- if (marginHint.isValid()) { -- bottom = marginHint.height(); -- } else { -- bottom = m_shadowPixmaps[4].height(); // bottom -- } -- } else { -- bottom = 1; -- } -- -- if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -- marginHint = q->elementSize("shadow-hint-left-margin"); -- if (marginHint.isValid()) { -- left = marginHint.width(); -- } else { -- left = m_shadowPixmaps[6].width(); // left -- } -- } else { -- left = 1; -- } -- -- data[enabledBorders] << top << right << bottom << left; --} -- --void PanelShadows::Private::freeX11Pixmaps() --{ --#if HAVE_X11 -- if (!m_isX11) { -- return; -- } -- foreach (const QPixmap &pixmap, m_shadowPixmaps) { -- if (!QX11Info::display()) { -- return; -- } -- if (!pixmap.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(pixmap))); -- } -- } -- -- if (!m_emptyCornerPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerPix))); -- } -- if (!m_emptyCornerBottomPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerBottomPix))); -- } -- if (!m_emptyCornerLeftPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerLeftPix))); -- } -- if (!m_emptyCornerRightPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerRightPix))); -- } -- if (!m_emptyCornerTopPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerTopPix))); -- } -- if (!m_emptyVerticalPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyVerticalPix))); -- } -- if (!m_emptyHorizontalPix.isNull()) { -- XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyHorizontalPix))); -- } --#endif --} -- --void PanelShadows::Private::clearPixmaps() --{ --#if HAVE_X11 -- freeX11Pixmaps(); -- -- m_emptyCornerPix = QPixmap(); -- m_emptyCornerBottomPix = QPixmap(); -- m_emptyCornerLeftPix = QPixmap(); -- m_emptyCornerRightPix = QPixmap(); -- m_emptyCornerTopPix = QPixmap(); -- m_emptyVerticalPix = QPixmap(); -- m_emptyHorizontalPix = QPixmap(); --#endif -- m_shadowPixmaps.clear(); -- data.clear(); --} -- --void PanelShadows::Private::updateShadow(const QWindow *window, Plasma::FrameSvg::EnabledBorders enabledBorders) --{ --#if HAVE_X11 -- if (!m_isX11) { -- return; -- } -- if (m_shadowPixmaps.isEmpty()) { -- setupPixmaps(); -- } -- -- if (!data.contains(enabledBorders)) { -- setupData(enabledBorders); -- } -- -- Display *dpy = QX11Info::display(); -- Atom atom = XInternAtom(dpy, "_KDE_NET_WM_SHADOW", False); -- --// qDebug() << "going to set the shadow of" << window->winId() << "to" << data; -- XChangeProperty(dpy, window->winId(), atom, XA_CARDINAL, 32, PropModeReplace, -- reinterpret_cast(data[enabledBorders].constData()), data[enabledBorders].size()); --#else -- Q_UNUSED(window) -- Q_UNUSED(enabledBorders) --#endif --} -- --void PanelShadows::Private::clearShadow(const QWindow *window) --{ --#if HAVE_X11 -- if (!m_isX11) { -- return; -- } -- Display *dpy = QX11Info::display(); -- Atom atom = XInternAtom(dpy, "_KDE_NET_WM_SHADOW", False); -- XDeleteProperty(dpy, window->winId(), atom); --#else -- Q_UNUSED(window) --#endif --} -- - bool PanelShadows::enabled() const - { - return hasElement("shadow-left"); -diff --git a/shell/panelshadows_p.h b/shell/panelshadows_p.h -index cce9a0f..1e66c2f 100644 ---- a/shell/panelshadows_p.h -+++ b/shell/panelshadows_p.h -@@ -24,6 +24,7 @@ - #include "plasma/framesvg.h" - #include "plasma/svg.h" - -+class PlatformPanelShadows; - - class PanelShadows : public Plasma::Svg - { -@@ -41,8 +42,7 @@ public: - bool enabled() const; - - private: -- class Private; -- Private * const d; -+ PlatformPanelShadows *d; - - Q_PRIVATE_SLOT(d, void updateShadows()) - Q_PRIVATE_SLOT(d, void windowDestroyed(QObject *deletedObject)) -diff --git a/shell/panelview.cpp b/shell/panelview.cpp -index 997f8d0..14cb776 100644 ---- a/shell/panelview.cpp -+++ b/shell/panelview.cpp -@@ -1,4 +1,5 @@ - /* -+ * Copyright 2014 Pier Luigi Fiorini - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify -@@ -20,9 +21,17 @@ - - #include "panelview.h" - #include "shellcorona.h" -+#include "shellmanager.h" - #include "panelshadows_p.h" - #include "panelconfigview.h" - -+#if HAVE_X11 -+# include "platform/platformpanelview_x11.h" -+#endif -+#if HAVE_WAYLAND -+# include "platform/platformpanelview_wayland.h" -+#endif -+ - #include - #include - #include -@@ -39,11 +48,6 @@ - #include - #include - --#if HAVE_X11 --#include --#include --#endif -- - static const int MINSIZE = 10; - - PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent) -@@ -58,9 +62,21 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent - m_visibilityMode(NormalPanel), - m_background(0) - { -+#if HAVE_X11 -+ if (m_impl.isNull() && QGuiApplication::platformName() == QStringLiteral("xcb")) { -+ m_impl.reset(new PlatformPanelViewX11(this)); -+ } -+#endif -+#if HAVE_WAYLAND -+ if (m_impl.isNull() && QGuiApplication::platformName().startsWith(QStringLiteral("wayland"))) { -+ m_impl.reset(new PlatformPanelViewWayland(this)); -+ } -+#endif -+ - if (targetScreen) { -- setScreen(targetScreen); -+ m_impl->setScreen(targetScreen); - } -+ - setResizeMode(QQuickView::SizeRootObjectToView); - setClearBeforeRendering(true); - setColor(QColor(Qt::transparent)); -@@ -323,11 +339,7 @@ void PanelView::setVisibilityMode(PanelView::VisibilityMode mode) - { - m_visibilityMode = mode; - -- if (mode == LetWindowsCover) { -- KWindowSystem::setState(winId(), NET::KeepBelow); -- } else { -- KWindowSystem::clearState(winId(), NET::KeepBelow); -- } -+ m_impl->setVisibilityMode(mode); - - disconnect(containment(), &Plasma::Applet::activated, this, &PanelView::showTemporarily); - if (!(mode == NormalPanel || mode == WindowsGoBelow || mode == AutoHide)) { -@@ -399,7 +411,7 @@ void PanelView::positionPanel() - - setPosition(geometryByDistance(m_distance).topLeft()); - -- KWindowEffects::slideWindow(winId(), slideLocation, -1); -+ m_impl->slide(slideLocation); - } - - QRect PanelView::geometryByDistance(int distance) const -@@ -535,7 +547,7 @@ void PanelView::showConfigurationInterface(Plasma::Applet *applet) - m_panelConfigView.data()->hide(); - } else { - m_panelConfigView.data()->show(); -- KWindowSystem::setState(m_panelConfigView.data()->winId(), NET::SkipTaskbar | NET::SkipPager); -+ m_impl->setConfigViewState(m_panelConfigView.data()); - } - return; - } else if (m_panelConfigView) { -@@ -558,7 +570,7 @@ void PanelView::showConfigurationInterface(Plasma::Applet *applet) - m_panelConfigView.data()->show(); - - if (cont && cont->isContainment()) { -- KWindowSystem::setState(m_panelConfigView.data()->winId(), NET::SkipTaskbar | NET::SkipPager); -+ m_impl->setConfigViewState(m_panelConfigView.data()); - } - } - -@@ -569,55 +581,7 @@ void PanelView::restoreAutoHide() - - void PanelView::setAutoHideEnabled(bool enabled) - { --#if HAVE_X11 -- xcb_connection_t *c = QX11Info::connection(); -- if (!c) { -- return; -- } -- -- const QByteArray effectName = QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"); -- xcb_intern_atom_cookie_t atomCookie = xcb_intern_atom_unchecked(c, false, effectName.length(), effectName.constData()); -- -- QScopedPointer atom(xcb_intern_atom_reply(c, atomCookie, NULL)); -- -- if (!atom) { -- return; -- } -- -- if (!enabled) { -- xcb_delete_property(c, winId(), atom->atom); -- return; -- } -- -- KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge; -- uint32_t value = 0; -- -- switch (location()) { -- case Plasma::Types::TopEdge: -- value = 0; -- slideLocation = KWindowEffects::TopEdge; -- break; -- case Plasma::Types::RightEdge: -- value = 1; -- slideLocation = KWindowEffects::RightEdge; -- break; -- case Plasma::Types::BottomEdge: -- value = 2; -- slideLocation = KWindowEffects::BottomEdge; -- break; -- case Plasma::Types::LeftEdge: -- value = 3; -- slideLocation = KWindowEffects::LeftEdge; -- break; -- case Plasma::Types::Floating: -- default: -- value = 4; -- break; -- } -- -- xcb_change_property(c, XCB_PROP_MODE_REPLACE, winId(), atom->atom, XCB_ATOM_CARDINAL, 32, 1, &value); -- KWindowEffects::slideWindow(winId(), slideLocation, -1); --#endif -+ m_impl->setAutoHideEnabled(enabled); - } - - void PanelView::resizeEvent(QResizeEvent *ev) -@@ -636,8 +600,7 @@ void PanelView::moveEvent(QMoveEvent *ev) - - void PanelView::integrateScreen() - { -- KWindowSystem::setOnAllDesktops(winId(), true); -- KWindowSystem::setType(winId(), NET::Dock); -+ m_impl->setup(); - setVisibilityMode(m_visibilityMode); - - containment()->reactToScreenChange(); -@@ -676,49 +639,7 @@ bool PanelView::event(QEvent *e) - - void PanelView::updateMask() - { -- if (KWindowSystem::compositingActive()) { -- setMask(QRegion()); -- } else { -- if (!m_background) { -- m_background = new Plasma::FrameSvg(this); -- m_background->setImagePath("widgets/panel-background"); -- } -- -- Plasma::FrameSvg::EnabledBorders borders = Plasma::FrameSvg::AllBorders; -- switch (location()) { -- case Plasma::Types::TopEdge: -- borders &= ~Plasma::FrameSvg::TopBorder; -- break; -- case Plasma::Types::LeftEdge: -- borders &= ~Plasma::FrameSvg::LeftBorder; -- break; -- case Plasma::Types::RightEdge: -- borders &= ~Plasma::FrameSvg::RightBorder; -- break; -- case Plasma::Types::BottomEdge: -- borders &= ~Plasma::FrameSvg::BottomBorder; -- break; -- default: -- break; -- } -- -- if (x() <= screen()->geometry().x()) { -- borders &= ~Plasma::FrameSvg::LeftBorder; -- } -- if (x() + width() >= screen()->geometry().x() + screen()->geometry().width()) { -- borders &= ~Plasma::FrameSvg::RightBorder; -- } -- if (y() <= screen()->geometry().y()) { -- borders &= ~Plasma::FrameSvg::TopBorder; -- } -- if (y() + height() >= screen()->geometry().y() + screen()->geometry().height()) { -- borders &= ~Plasma::FrameSvg::BottomBorder; -- } -- m_background->setEnabledBorders(borders); -- -- m_background->resizeFrame(size()); -- setMask(m_background->mask()); -- } -+ m_impl->updateMask(); - } - - void PanelView::updateStruts() -@@ -727,119 +648,12 @@ void PanelView::updateStruts() - return; - } - -- NETExtendedStrut strut; -- -- if (m_visibilityMode == NormalPanel) { -- const QRect thisScreen = screen()->geometry(); -- const QRect wholeScreen = screen()->virtualGeometry(); -- -- //Extended struts against a screen edge near to another screen are really harmful, so windows maximized under the panel is a lesser pain -- //TODO: force "windows can cover" in those cases? -- const int numScreens = corona()->numScreens(); -- for (int i = 0; i < numScreens; ++i) { -- if (i == containment()->screen()) { -- continue; -- } -- -- const QRect otherScreen = corona()->screenGeometry(i); -- -- switch (location()) -- { -- case Plasma::Types::TopEdge: -- if (otherScreen.bottom() <= thisScreen.top()) { -- KWindowSystem::setExtendedStrut(winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -- return; -- } -- break; -- case Plasma::Types::BottomEdge: -- if (otherScreen.top() >= thisScreen.bottom()) { -- KWindowSystem::setExtendedStrut(winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -- return; -- } -- break; -- case Plasma::Types::RightEdge: -- if (otherScreen.left() >= thisScreen.right()) { -- KWindowSystem::setExtendedStrut(winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -- return; -- } -- break; -- case Plasma::Types::LeftEdge: -- if (otherScreen.right() <= thisScreen.left()) { -- KWindowSystem::setExtendedStrut(winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -- return; -- } -- break; -- default: -- return; -- } -- } -- // extended struts are to the combined screen geoms, not the single screen -- int leftOffset = thisScreen.x(); -- int rightOffset = wholeScreen.right() - thisScreen.right(); -- int bottomOffset = wholeScreen.bottom() - thisScreen.bottom(); --// qDebug() << "screen l/r/b/t offsets are:" << leftOffset << rightOffset << bottomOffset << topOffset << location(); -- int topOffset = thisScreen.top(); -- -- switch (location()) -- { -- case Plasma::Types::TopEdge: -- strut.top_width = thickness() + topOffset; -- strut.top_start = x(); -- strut.top_end = x() + width() - 1; --// qDebug() << "setting top edge to" << strut.top_width << strut.top_start << strut.top_end; -- break; -- -- case Plasma::Types::BottomEdge: -- strut.bottom_width = thickness() + bottomOffset; -- strut.bottom_start = x(); -- strut.bottom_end = x() + width() - 1; --// qDebug() << "setting bottom edge to" << strut.bottom_width << strut.bottom_start << strut.bottom_end; -- break; -- -- case Plasma::Types::RightEdge: -- strut.right_width = thickness() + rightOffset; -- strut.right_start = y(); -- strut.right_end = y() + height() - 1; --// qDebug() << "setting right edge to" << strut.right_width << strut.right_start << strut.right_end; -- break; -- -- case Plasma::Types::LeftEdge: -- strut.left_width = thickness() + leftOffset; -- strut.left_start = y(); -- strut.left_end = y() + height() - 1; --// qDebug() << "setting left edge to" << strut.left_width << strut.left_start << strut.left_end; -- break; -- -- default: -- //qDebug() << "where are we?"; -- break; -- } -- } -- -- KWindowSystem::setExtendedStrut(winId(), strut.left_width, -- strut.left_start, -- strut.left_end, -- strut.right_width, -- strut.right_start, -- strut.right_end, -- strut.top_width, -- strut.top_start, -- strut.top_end, -- strut.bottom_width, -- strut.bottom_start, -- strut.bottom_end); -- -+ m_impl->updateStruts(); - } - - void PanelView::themeChanged() - { -- KWindowEffects::enableBlurBehind(winId(), true); -- KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), -- m_theme.backgroundContrast(), -- m_theme.backgroundIntensity(), -- m_theme.backgroundSaturation()); -- -- updateMask(); -+ m_impl->themeChanged(); - } - - void PanelView::containmentChanged() -diff --git a/shell/panelview.h b/shell/panelview.h -index 51c76f8..288151f 100644 ---- a/shell/panelview.h -+++ b/shell/panelview.h -@@ -1,4 +1,5 @@ - /* -+ * Copyright 2014 Pier Luigi Fiorini - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify -@@ -23,10 +24,14 @@ - #include - #include - -+#include "config-plasma.h" - #include "plasmaquick/view.h" - #include "plasmaquick/configview.h" - - class ShellCorona; -+class PlatformPanelView; -+class PlatformPanelViewX11; -+class PlatformPanelViewWayland; - - class PanelView : public PlasmaQuick::View - { -@@ -181,8 +186,13 @@ private: - QTimer m_unhideTimer; - //only for the mask, not to actually paint - Plasma::FrameSvg *m_background; -+ QScopedPointer m_impl; - - static const int STRUTSTIMERDELAY = 200; -+ -+ friend class PlatformPanelView; -+ friend class PlatformPanelViewX11; -+ friend class PlatformPanelViewWayland; - }; - - #endif // PANELVIEW_H -diff --git a/shell/platform/platformdesktopview.cpp b/shell/platform/platformdesktopview.cpp -new file mode 100644 -index 0000000..092a6e1 ---- /dev/null -+++ b/shell/platform/platformdesktopview.cpp -@@ -0,0 +1,43 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformdesktopview.h" -+ -+PlatformDesktopView::PlatformDesktopView(DesktopView *q) -+ : q(q) -+{ -+} -+ -+PlatformDesktopView::~PlatformDesktopView() -+{ -+} -+ -+void PlatformDesktopView::setWindowType(const DesktopView::WindowType &type) -+{ -+ Q_UNUSED(type); -+} -+ -+void PlatformDesktopView::setScreen(QScreen *screen) -+{ -+ q->setScreen(screen); -+} -+ -+void PlatformDesktopView::setDashboardShown(bool shown) -+{ -+ Q_UNUSED(shown); -+} -diff --git a/shell/platform/platformdesktopview.h b/shell/platform/platformdesktopview.h -new file mode 100644 -index 0000000..06e8c6f ---- /dev/null -+++ b/shell/platform/platformdesktopview.h -@@ -0,0 +1,38 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMDESKTOPVIEW_H -+#define PLATFORMDESKTOPVIEW_H -+ -+#include "desktopview.h" -+ -+class PlatformDesktopView -+{ -+public: -+ PlatformDesktopView(DesktopView *q); -+ virtual ~PlatformDesktopView(); -+ -+ virtual void setWindowType(const DesktopView::WindowType &type); -+ virtual void setScreen(QScreen *screen); -+ virtual void setDashboardShown(bool shown); -+ -+protected: -+ DesktopView *const q; -+}; -+ -+#endif // PLATFORMDESKTOPVIEW_H -diff --git a/shell/platform/platformdesktopview_wayland.cpp b/shell/platform/platformdesktopview_wayland.cpp -new file mode 100644 -index 0000000..caedb69 ---- /dev/null -+++ b/shell/platform/platformdesktopview_wayland.cpp -@@ -0,0 +1,89 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformdesktopview_wayland.h" -+#include "shellmanager.h" -+#include "waylandinterface.h" -+ -+#include -+#include -+ -+PlatformDesktopViewWayland::PlatformDesktopViewWayland(DesktopView *q) -+ : PlatformDesktopView(q) -+ , m_windowTypeSet(false) -+ , m_plasmaSurface(Q_NULLPTR) -+{ -+} -+ -+void PlatformDesktopViewWayland::setWindowType(const DesktopView::WindowType &type) -+{ -+ if (m_windowTypeSet) { -+ return; -+ } -+ -+ if (type != DesktopView::Desktop || ShellManager::s_forceWindowed) { -+ if (m_plasmaSurface) { -+ delete m_plasmaSurface; -+ m_plasmaSurface = Q_NULLPTR; -+ } -+ } -+ -+ if (type == DesktopView::Window || ShellManager::s_forceWindowed) { -+ q->setFlags(Qt::Window); -+ q->setVisibility(QWindow::Windowed); -+ } else if (type == DesktopView::FullScreen) { -+ q->setFlags(Qt::Window); -+ q->setVisibility(QWindow::FullScreen); -+ } else if (type == DesktopView::Desktop) { -+ Q_ASSERT(!m_plasmaSurface); -+ Q_ASSERT(WaylandInterface::plasmaShell()); -+ -+ q->setFlags(Qt::BypassWindowManagerHint); -+ -+ m_plasmaSurface = WaylandInterface::plasmaShell()->createSurface(q, q); -+ -+ if (q->isDashboardShown()) -+ m_plasmaSurface->setRole(KWayland::Client::PlasmaSurface::Role::Dashboard); -+ else -+ m_plasmaSurface->setRole(KWayland::Client::PlasmaSurface::Role::Desktop); -+ } else if (type == DesktopView::WindowedDesktop) { -+ q->setFlags(Qt::FramelessWindowHint); -+ q->setVisibility(QWindow::Maximized); -+ } -+ -+ m_windowTypeSet = true; -+} -+ -+void PlatformDesktopViewWayland::setScreen(QScreen *screen) -+{ -+ if (!m_plasmaSurface) -+ return; -+ -+ m_plasmaSurface->setOutput(screen); -+} -+ -+void PlatformDesktopViewWayland::setDashboardShown(bool shown) -+{ -+ if (q->windowType() != DesktopView::Desktop) -+ return; -+ -+ if (shown) -+ m_plasmaSurface->setRole(KWayland::Client::PlasmaSurface::Role::Dashboard); -+ else -+ m_plasmaSurface->setRole(KWayland::Client::PlasmaSurface::Role::Desktop); -+} -diff --git a/shell/platform/platformdesktopview_wayland.h b/shell/platform/platformdesktopview_wayland.h -new file mode 100644 -index 0000000..07169f3 ---- /dev/null -+++ b/shell/platform/platformdesktopview_wayland.h -@@ -0,0 +1,44 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMDESKTOPVIEW_WAYLAND_H -+#define PLATFORMDESKTOPVIEW_WAYLAND_H -+ -+#include "platformdesktopview.h" -+ -+namespace KWayland { -+ namespace Client { -+ class PlasmaSurface; -+ } -+} -+ -+class PlatformDesktopViewWayland : public PlatformDesktopView -+{ -+public: -+ PlatformDesktopViewWayland(DesktopView *q); -+ -+ void setWindowType(const DesktopView::WindowType &type); -+ void setScreen(QScreen *screen); -+ void setDashboardShown(bool shown); -+ -+private: -+ bool m_windowTypeSet; -+ KWayland::Client::PlasmaSurface *m_plasmaSurface; -+}; -+ -+#endif // PLATFORMDESKTOPVIEW_WAYLAND_H -diff --git a/shell/platform/platformdesktopview_x11.cpp b/shell/platform/platformdesktopview_x11.cpp -new file mode 100644 -index 0000000..81ae507 ---- /dev/null -+++ b/shell/platform/platformdesktopview_x11.cpp -@@ -0,0 +1,72 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * Copyright 2013 Marco Martin -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformdesktopview_x11.h" -+#include "shellmanager.h" -+ -+#include -+ -+PlatformDesktopViewX11::PlatformDesktopViewX11(DesktopView *q) -+ : PlatformDesktopView(q) -+{ -+} -+ -+void PlatformDesktopViewX11::setWindowType(const DesktopView::WindowType &type) -+{ -+ if (type == DesktopView::Window || ShellManager::s_forceWindowed) { -+ q->setFlags(Qt::Window); -+ KWindowSystem::setType(q->winId(), NET::Normal); -+ KWindowSystem::clearState(q->winId(), NET::FullScreen); -+ } else if (type == DesktopView::Desktop) { -+ q->setFlags(Qt::Window); -+ KWindowSystem::setType(q->winId(), NET::Desktop); -+ KWindowSystem::setState(q->winId(), NET::KeepBelow); -+ } else if (type == DesktopView::WindowedDesktop) { -+ KWindowSystem::setType(q->winId(), NET::Normal); -+ KWindowSystem::clearState(q->winId(), NET::FullScreen); -+ q->setFlags(Qt::FramelessWindowHint | q->flags()); -+ } else if (type == DesktopView::FullScreen) { -+ q->setFlags(Qt::Window); -+ KWindowSystem::setType(q->winId(), NET::Normal); -+ KWindowSystem::setState(q->winId(), NET::FullScreen); -+ } -+} -+ -+void PlatformDesktopViewX11::setDashboardShown(bool shown) -+{ -+ if (shown) { -+ if (q->windowType() == DesktopView::Desktop) { -+ KWindowSystem::setType(q->winId(), NET::Normal); -+ KWindowSystem::clearState(q->winId(), NET::KeepBelow); -+ KWindowSystem::setState(q->winId(), NET::SkipTaskbar|NET::SkipPager); -+ } -+ q->setFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint); -+ -+ q->raise(); -+ KWindowSystem::raiseWindow(q->winId()); -+ KWindowSystem::forceActiveWindow(q->winId()); -+ } else { -+ if (q->windowType() == DesktopView::Desktop) { -+ KWindowSystem::setType(q->winId(), NET::Desktop); -+ KWindowSystem::setState(q->winId(), NET::SkipTaskbar|NET::SkipPager|NET::KeepBelow); -+ } -+ q->lower(); -+ KWindowSystem::lowerWindow(q->winId()); -+ } -+} -diff --git a/shell/platform/platformdesktopview_x11.h b/shell/platform/platformdesktopview_x11.h -new file mode 100644 -index 0000000..3bab373 ---- /dev/null -+++ b/shell/platform/platformdesktopview_x11.h -@@ -0,0 +1,33 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMDESKTOPVIEW_X11_H -+#define PLATFORMDESKTOPVIEW_X11_H -+ -+#include "platformdesktopview.h" -+ -+class PlatformDesktopViewX11 : public PlatformDesktopView -+{ -+public: -+ PlatformDesktopViewX11(DesktopView *q); -+ -+ void setWindowType(const DesktopView::WindowType &type); -+ void setDashboardShown(bool shown); -+}; -+ -+#endif // PLATFORMDESKTOPVIEW_X11_H -diff --git a/shell/platform/platformpanelshadows.cpp b/shell/platform/platformpanelshadows.cpp -new file mode 100644 -index 0000000..8c765e8 ---- /dev/null -+++ b/shell/platform/platformpanelshadows.cpp -@@ -0,0 +1,160 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * Copyright 2011 Aaron Seigo -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "panelshadows_p.h" -+#include "platformpanelshadows.h" -+ -+PlatformPanelShadows::PlatformPanelShadows(PanelShadows *q) -+ : q(q) -+{ -+} -+ -+PlatformPanelShadows::~PlatformPanelShadows() -+{ -+} -+ -+void PlatformPanelShadows::windowDestroyed(QObject *deletedObject) -+{ -+ m_windows.remove(static_cast(deletedObject)); -+ -+ if (m_windows.isEmpty()) { -+ clearPixmaps(); -+ } -+} -+ -+void PlatformPanelShadows::updateShadows() -+{ -+ setupPixmaps(); -+ QHash::const_iterator i; -+ for (i = m_windows.constBegin(); i != m_windows.constEnd(); ++i) { -+ updateShadow(i.key(), i.value()); -+ } -+} -+ -+Qt::HANDLE PlatformPanelShadows::createPixmap(const QPixmap& source) -+{ -+ Q_UNUSED(source); -+ return 0; -+} -+ -+void PlatformPanelShadows::initPixmap(const QString &element) -+{ -+ m_shadowPixmaps << q->pixmap(element); -+} -+ -+QPixmap PlatformPanelShadows::initEmptyPixmap(const QSize &size) -+{ -+ Q_UNUSED(size) -+ return QPixmap(); -+} -+ -+void PlatformPanelShadows::setupPixmaps() -+{ -+ clearPixmaps(); -+ initPixmap("shadow-top"); -+ initPixmap("shadow-topright"); -+ initPixmap("shadow-right"); -+ initPixmap("shadow-bottomright"); -+ initPixmap("shadow-bottom"); -+ initPixmap("shadow-bottomleft"); -+ initPixmap("shadow-left"); -+ initPixmap("shadow-topleft"); -+ -+ m_emptyCornerPix = initEmptyPixmap(QSize(1,1)); -+ m_emptyCornerLeftPix = initEmptyPixmap(QSize(q->elementSize("shadow-topleft").width(), 1)); -+ m_emptyCornerTopPix = initEmptyPixmap(QSize(1, q->elementSize("shadow-topleft").height())); -+ m_emptyCornerRightPix = initEmptyPixmap(QSize(q->elementSize("shadow-bottomright").width(), 1)); -+ m_emptyCornerBottomPix = initEmptyPixmap(QSize(1, q->elementSize("shadow-bottomright").height())); -+ m_emptyVerticalPix = initEmptyPixmap(QSize(1, q->elementSize("shadow-left").height())); -+ m_emptyHorizontalPix = initEmptyPixmap(QSize(q->elementSize("shadow-top").width(), 1)); -+ -+} -+ -+void PlatformPanelShadows::setupData(Plasma::FrameSvg::EnabledBorders enabledBorders) -+{ -+ int left, top, right, bottom = 0; -+ -+ QSize marginHint; -+ if (enabledBorders & Plasma::FrameSvg::TopBorder) { -+ marginHint = q->elementSize("shadow-hint-top-margin"); -+ if (marginHint.isValid()) { -+ top = marginHint.height(); -+ } else { -+ top = m_shadowPixmaps[0].height(); // top -+ } -+ } else { -+ top = 1; -+ } -+ -+ if (enabledBorders & Plasma::FrameSvg::RightBorder) { -+ marginHint = q->elementSize("shadow-hint-right-margin"); -+ if (marginHint.isValid()) { -+ right = marginHint.width(); -+ } else { -+ right = m_shadowPixmaps[2].width(); // right -+ } -+ } else { -+ right = 1; -+ } -+ -+ if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -+ marginHint = q->elementSize("shadow-hint-bottom-margin"); -+ if (marginHint.isValid()) { -+ bottom = marginHint.height(); -+ } else { -+ bottom = m_shadowPixmaps[4].height(); // bottom -+ } -+ } else { -+ bottom = 1; -+ } -+ -+ if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -+ marginHint = q->elementSize("shadow-hint-left-margin"); -+ if (marginHint.isValid()) { -+ left = marginHint.width(); -+ } else { -+ left = m_shadowPixmaps[6].width(); // left -+ } -+ } else { -+ left = 1; -+ } -+ -+ data[enabledBorders] << top << right << bottom << left; -+} -+ -+void PlatformPanelShadows::freeX11Pixmaps() -+{ -+} -+ -+void PlatformPanelShadows::clearPixmaps() -+{ -+ m_shadowPixmaps.clear(); -+ data.clear(); -+} -+ -+void PlatformPanelShadows::updateShadow(const QWindow *window, Plasma::FrameSvg::EnabledBorders enabledBorders) -+{ -+ Q_UNUSED(window) -+ Q_UNUSED(enabledBorders) -+} -+ -+void PlatformPanelShadows::clearShadow(const QWindow *window) -+{ -+ Q_UNUSED(window) -+} -diff --git a/shell/platform/platformpanelshadows.h b/shell/platform/platformpanelshadows.h -new file mode 100644 -index 0000000..c1951aa ---- /dev/null -+++ b/shell/platform/platformpanelshadows.h -@@ -0,0 +1,62 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * Copyright 2011 Aaron Seigo -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMPANELSHADOWS_H -+#define PLATFORMPANELSHADOWS_H -+ -+#include -+ -+#include "plasma/framesvg.h" -+ -+class PanelShadows; -+ -+class PlatformPanelShadows -+{ -+public: -+ PlatformPanelShadows(PanelShadows *shadows); -+ virtual ~PlatformPanelShadows(); -+ -+ virtual void freeX11Pixmaps(); -+ virtual void clearPixmaps(); -+ virtual void setupPixmaps(); -+ virtual Qt::HANDLE createPixmap(const QPixmap& source); -+ virtual void initPixmap(const QString &element); -+ virtual QPixmap initEmptyPixmap(const QSize &size); -+ virtual void updateShadow(const QWindow *window, Plasma::FrameSvg::EnabledBorders); -+ virtual void clearShadow(const QWindow *window); -+ virtual void updateShadows(); -+ virtual void windowDestroyed(QObject *deletedObject); -+ virtual void setupData(Plasma::FrameSvg::EnabledBorders enabledBorders); -+ -+ PanelShadows *q; -+ QList m_shadowPixmaps; -+ -+ QPixmap m_emptyCornerPix; -+ QPixmap m_emptyCornerLeftPix; -+ QPixmap m_emptyCornerTopPix; -+ QPixmap m_emptyCornerRightPix; -+ QPixmap m_emptyCornerBottomPix; -+ QPixmap m_emptyVerticalPix; -+ QPixmap m_emptyHorizontalPix; -+ -+ QHash > data; -+ QHash m_windows; -+}; -+ -+#endif // PLATFORMPANELSHADOWS_H -diff --git a/shell/platform/platformpanelshadows_x11.cpp b/shell/platform/platformpanelshadows_x11.cpp -new file mode 100644 -index 0000000..2816de8 ---- /dev/null -+++ b/shell/platform/platformpanelshadows_x11.cpp -@@ -0,0 +1,247 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * Copyright 2011 Aaron Seigo -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformpanelshadows_x11.h" -+ -+PlatformPanelShadowsX11::PlatformPanelShadowsX11(PanelShadows *shadows) -+ : PlatformPanelShadows(shadows) -+ , _connection(0) -+ , _gc(0) -+{ -+} -+ -+PlatformPanelShadowsX11::~PlatformPanelShadowsX11() -+{ -+ // Do not call clearPixmaps() from here: it creates new QPixmap(), -+ // which causes a crash when application is stopping. -+ freeX11Pixmaps(); -+} -+ -+Qt::HANDLE PlatformPanelShadowsX11::createPixmap(const QPixmap& source) -+{ -+ // do nothing for invalid pixmaps -+ if( source.isNull() ) return 0; -+ -+ /* -+ in some cases, pixmap handle is invalid. This is the case notably -+ when Qt uses to RasterEngine. In this case, we create an X11 Pixmap -+ explicitly and draw the source pixmap on it. -+ */ -+ -+ // check connection -+ if( !_connection ) _connection = QX11Info::connection(); -+ -+ const int width( source.width() ); -+ const int height( source.height() ); -+ -+ // create X11 pixmap -+ Pixmap pixmap = XCreatePixmap( QX11Info::display(), QX11Info::appRootWindow(), width, height, 32 ); -+ -+ // check gc -+ if( !_gc ) -+ { -+ _gc = xcb_generate_id( _connection ); -+ xcb_create_gc( _connection, _gc, pixmap, 0, 0x0 ); -+ } -+ -+// // create explicitly shared QPixmap from it -+// QPixmap dest( QPixmap::fromX11Pixmap( pixmap, QPixmap::ExplicitlyShared ) ); -+// -+// // create surface for pixmap -+// { -+// QPainter painter( &dest ); -+// painter.setCompositionMode( QPainter::CompositionMode_Source ); -+// painter.drawPixmap( 0, 0, source ); -+// } -+// -+// -+// return pixmap; -+ QImage image( source.toImage() ); -+ xcb_put_image( -+ _connection, XCB_IMAGE_FORMAT_Z_PIXMAP, pixmap, _gc, -+ image.width(), image.height(), 0, 0, -+ 0, 32, -+ image.byteCount(), image.constBits()); -+ -+ return (Qt::HANDLE)pixmap; -+} -+ -+QPixmap PlatformPanelShadowsX11::initEmptyPixmap(const QSize &size) -+{ -+ QPixmap tempEmptyPix(size); -+ if (!size.isEmpty()) { -+ tempEmptyPix.fill(Qt::transparent); -+ } -+ return tempEmptyPix; -+} -+ -+void PlatformPanelShadowsX11::setupData(Plasma::FrameSvg::EnabledBorders enabledBorders) -+{ -+ //shadow-top -+ if (enabledBorders & Plasma::FrameSvg::TopBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[0])); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyHorizontalPix)); -+ } -+ -+ //shadow-topright -+ if (enabledBorders & Plasma::FrameSvg::TopBorder && -+ enabledBorders & Plasma::FrameSvg::RightBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[1])); -+ } else if (enabledBorders & Plasma::FrameSvg::TopBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerTopPix)); -+ } else if (enabledBorders & Plasma::FrameSvg::RightBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerRightPix)); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -+ } -+ -+ //shadow-right -+ if (enabledBorders & Plasma::FrameSvg::RightBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[2])); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyVerticalPix)); -+ } -+ -+ //shadow-bottomright -+ if (enabledBorders & Plasma::FrameSvg::BottomBorder && -+ enabledBorders & Plasma::FrameSvg::RightBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[3])); -+ } else if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerBottomPix)); -+ } else if (enabledBorders & Plasma::FrameSvg::RightBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerRightPix)); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -+ } -+ -+ //shadow-bottom -+ if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[4])); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyHorizontalPix)); -+ } -+ -+ //shadow-bottomleft -+ if (enabledBorders & Plasma::FrameSvg::BottomBorder && -+ enabledBorders & Plasma::FrameSvg::LeftBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[5])); -+ } else if (enabledBorders & Plasma::FrameSvg::BottomBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerBottomPix)); -+ } else if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerLeftPix)); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -+ } -+ -+ //shadow-left -+ if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[6])); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyVerticalPix)); -+ } -+ -+ //shadow-topleft -+ if (enabledBorders & Plasma::FrameSvg::TopBorder && -+ enabledBorders & Plasma::FrameSvg::LeftBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_shadowPixmaps[7])); -+ } else if (enabledBorders & Plasma::FrameSvg::TopBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerTopPix)); -+ } else if (enabledBorders & Plasma::FrameSvg::LeftBorder) { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerLeftPix)); -+ } else { -+ data[enabledBorders] << reinterpret_cast(createPixmap(m_emptyCornerPix)); -+ } -+ -+ PlatformPanelShadows::setupData(enabledBorders); -+} -+ -+void PlatformPanelShadowsX11::freeX11Pixmaps() -+{ -+ foreach (const QPixmap &pixmap, m_shadowPixmaps) { -+ if (!QX11Info::display()) { -+ return; -+ } -+ if (!pixmap.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(pixmap))); -+ } -+ } -+ -+ if (!m_emptyCornerPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerPix))); -+ } -+ if (!m_emptyCornerBottomPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerBottomPix))); -+ } -+ if (!m_emptyCornerLeftPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerLeftPix))); -+ } -+ if (!m_emptyCornerRightPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerRightPix))); -+ } -+ if (!m_emptyCornerTopPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyCornerTopPix))); -+ } -+ if (!m_emptyVerticalPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyVerticalPix))); -+ } -+ if (!m_emptyHorizontalPix.isNull()) { -+ XFreePixmap(QX11Info::display(), reinterpret_cast(createPixmap(m_emptyHorizontalPix))); -+ } -+} -+ -+void PlatformPanelShadowsX11::clearPixmaps() -+{ -+ freeX11Pixmaps(); -+ -+ m_emptyCornerPix = QPixmap(); -+ m_emptyCornerBottomPix = QPixmap(); -+ m_emptyCornerLeftPix = QPixmap(); -+ m_emptyCornerRightPix = QPixmap(); -+ m_emptyCornerTopPix = QPixmap(); -+ m_emptyVerticalPix = QPixmap(); -+ m_emptyHorizontalPix = QPixmap(); -+ -+ PlatformPanelShadows::clearPixmaps(); -+} -+ -+void PlatformPanelShadowsX11::updateShadow(const QWindow *window, Plasma::FrameSvg::EnabledBorders enabledBorders) -+{ -+ if (m_shadowPixmaps.isEmpty()) { -+ setupPixmaps(); -+ } -+ -+ if (!data.contains(enabledBorders)) { -+ setupData(enabledBorders); -+ } -+ -+ Display *dpy = QX11Info::display(); -+ Atom atom = XInternAtom(dpy, "_KDE_NET_WM_SHADOW", False); -+ -+// qDebug() << "going to set the shadow of" << window->winId() << "to" << data; -+ XChangeProperty(dpy, window->winId(), atom, XA_CARDINAL, 32, PropModeReplace, -+ reinterpret_cast(data[enabledBorders].constData()), data[enabledBorders].size()); -+} -+ -+void PlatformPanelShadowsX11::clearShadow(const QWindow *window) -+{ -+ Display *dpy = QX11Info::display(); -+ Atom atom = XInternAtom(dpy, "_KDE_NET_WM_SHADOW", False); -+ XDeleteProperty(dpy, window->winId(), atom); -+} -diff --git a/shell/platform/platformpanelshadows_x11.h b/shell/platform/platformpanelshadows_x11.h -new file mode 100644 -index 0000000..d3d7633 ---- /dev/null -+++ b/shell/platform/platformpanelshadows_x11.h -@@ -0,0 +1,53 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * Copyright 2011 Aaron Seigo -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMPANELSHADOWS_X11_H -+#define PLATFORMPANELSHADOWS_X11_H -+ -+#include "platformpanelshadows.h" -+ -+#include -+#include -+#include -+#include -+#include -+ -+class PlatformPanelShadowsX11 : public PlatformPanelShadows -+{ -+public: -+ PlatformPanelShadowsX11(PanelShadows *q); -+ virtual ~PlatformPanelShadowsX11(); -+ -+ Qt::HANDLE createPixmap(const QPixmap &source); -+ QPixmap initEmptyPixmap(const QSize &size); -+ void setupData(Plasma::FrameSvg::EnabledBorders enabledBorders); -+ void freeX11Pixmaps(); -+ void clearPixmaps(); -+ void updateShadow(const QWindow *window, Plasma::FrameSvg::EnabledBorders enabledBorders); -+ void clearShadow(const QWindow *window); -+ -+private: -+ //! xcb connection -+ xcb_connection_t* _connection; -+ -+ //! graphical context -+ xcb_gcontext_t _gc; -+}; -+ -+#endif // PLATFORMPANELSHADOWS_X11_H -diff --git a/shell/platform/platformpanelview.cpp b/shell/platform/platformpanelview.cpp -new file mode 100644 -index 0000000..d2dd8e3 ---- /dev/null -+++ b/shell/platform/platformpanelview.cpp -@@ -0,0 +1,79 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformpanelview.h" -+ -+PlatformPanelView::PlatformPanelView(PanelView *q) -+ : q(q) -+{ -+} -+ -+PlatformPanelView::~PlatformPanelView() -+{ -+} -+ -+void PlatformPanelView::setup() -+{ -+} -+ -+bool PlatformPanelView::isCompositingActive() const -+{ -+ return false; -+} -+ -+void PlatformPanelView::setScreen(QScreen *screen) -+{ -+ q->setScreen(screen); -+} -+ -+void PlatformPanelView::setVisibilityMode(const PanelView::VisibilityMode &mode) -+{ -+ Q_UNUSED(mode); -+} -+ -+void PlatformPanelView::setPosition(const QPoint &pos) -+{ -+ Q_UNUSED(pos); -+} -+ -+void PlatformPanelView::slide(const KWindowEffects::SlideFromLocation &from) -+{ -+ Q_UNUSED(from); -+} -+ -+void PlatformPanelView::setConfigViewState(PlasmaQuick::ConfigView *view) -+{ -+ Q_UNUSED(view); -+} -+ -+void PlatformPanelView::setAutoHideEnabled(bool enabled) -+{ -+ Q_UNUSED(enabled); -+} -+ -+void PlatformPanelView::updateStruts() -+{ -+} -+ -+void PlatformPanelView::themeChanged() -+{ -+} -+ -+void PlatformPanelView::updateMask() -+{ -+} -diff --git a/shell/platform/platformpanelview.h b/shell/platform/platformpanelview.h -new file mode 100644 -index 0000000..ae06ca8 ---- /dev/null -+++ b/shell/platform/platformpanelview.h -@@ -0,0 +1,51 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMPANELVIEW_H -+#define PLATFORMPANELVIEW_H -+ -+#include "panelview.h" -+ -+#include -+ -+class PlatformPanelView -+{ -+public: -+ PlatformPanelView(PanelView *q); -+ virtual ~PlatformPanelView(); -+ -+ virtual void setup(); -+ -+ virtual bool isCompositingActive() const; -+ -+ virtual void setScreen(QScreen *screen); -+ virtual void setVisibilityMode(const PanelView::VisibilityMode &mode); -+ virtual void setPosition(const QPoint &pos); -+ virtual void slide(const KWindowEffects::SlideFromLocation &from); -+ virtual void setConfigViewState(PlasmaQuick::ConfigView *view); -+ virtual void setAutoHideEnabled(bool enabled); -+ -+ virtual void updateStruts(); -+ virtual void themeChanged(); -+ virtual void updateMask(); -+ -+protected: -+ PanelView *const q; -+}; -+ -+#endif // PLATFORMPANELVIEW_H -diff --git a/shell/platform/platformpanelview_wayland.cpp b/shell/platform/platformpanelview_wayland.cpp -new file mode 100644 -index 0000000..b553998 ---- /dev/null -+++ b/shell/platform/platformpanelview_wayland.cpp -@@ -0,0 +1,114 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformpanelview_wayland.h" -+#include "waylandinterface.h" -+ -+using namespace KWayland::Client; -+ -+static PlasmaSurface::Flags visibility2Wl(PanelView::VisibilityMode mode) -+{ -+ switch (mode) { -+ case PanelView::AutoHide: -+ return PlasmaSurface::Flag::PanelAutoHide; -+ case PanelView::LetWindowsCover: -+ return PlasmaSurface::Flag::PanelWindowsCanCover; -+ case PanelView::WindowsGoBelow: -+ return PlasmaSurface::Flag::PanelWindowsGoBelow; -+ default: -+ break; -+ } -+ -+ return PlasmaSurface::Flag::PanelAlwaysVisible; -+} -+ -+static PlasmaEffects::Location location2Wl(KWindowEffects::SlideFromLocation location) -+{ -+ switch (location) { -+ case KWindowEffects::LeftEdge: -+ return PlasmaEffects::Location::Left; -+ case KWindowEffects::TopEdge: -+ return PlasmaEffects::Location::Top; -+ case KWindowEffects::RightEdge: -+ return PlasmaEffects::Location::Right; -+ case KWindowEffects::BottomEdge: -+ return PlasmaEffects::Location::Bottom; -+ default: -+ break; -+ } -+ -+ return PlasmaEffects::Location::None; -+} -+ -+PlatformPanelViewWayland::PlatformPanelViewWayland(PanelView *q) -+ : PlatformPanelView(q) -+{ -+ m_plasmaSurface = WaylandInterface::plasmaShell()->createSurface(q, q); -+ m_plasmaSurface->setRole(PlasmaSurface::Role::Panel); -+} -+ -+bool PlatformPanelViewWayland::isCompositingActive() const -+{ -+ return true; -+} -+ -+void PlatformPanelViewWayland::setScreen(QScreen *screen) -+{ -+ m_plasmaSurface->setOutput(screen); -+} -+ -+void PlatformPanelViewWayland::setVisibilityMode(const PanelView::VisibilityMode &mode) -+{ -+ m_plasmaSurface->setFlags(visibility2Wl(mode)); -+} -+ -+void PlatformPanelViewWayland::setPosition(const QPoint &pos) -+{ -+ m_plasmaSurface->move(pos); -+} -+ -+void PlatformPanelViewWayland::slideToLocation(const KWindowEffects::SlideFromLocation &from, -+ const QPoint &to) -+{ -+ Q_UNUSED(to); -+ WaylandInterface::plasmaEffects()->slide(q, location2Wl(from), q->geometry().topLeft()); -+} -+ -+void PlatformPanelViewWayland::setConfigViewState(PlasmaQuick::ConfigView *view) -+{ -+ Q_UNUSED(view); -+} -+ -+void PlatformPanelViewWayland::setAutoHideEnabled(bool enabled) -+{ -+ Q_UNUSED(enabled); -+} -+ -+void PlatformPanelViewWayland::themeChanged() -+{ -+ WaylandInterface::plasmaEffects()->enableBlurBehind(q, QRegion(q->geometry())); -+ WaylandInterface::plasmaEffects()->enableBackgroundContrast( -+ q, -+ QRegion(q->geometry()), -+ q->m_theme.backgroundContrast(), -+ q->m_theme.backgroundIntensity(), -+ q->m_theme.backgroundSaturation() -+ ); -+ -+ q->updateMask(); -+} -diff --git a/shell/platform/platformpanelview_wayland.h b/shell/platform/platformpanelview_wayland.h -new file mode 100644 -index 0000000..8c87114 ---- /dev/null -+++ b/shell/platform/platformpanelview_wayland.h -@@ -0,0 +1,47 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMPANELVIEW_WAYLAND_H -+#define PLATFORMPANELVIEW_WAYLAND_H -+ -+#include "platformpanelview.h" -+ -+#include -+ -+class PlatformPanelViewWayland : public PlatformPanelView -+{ -+public: -+ PlatformPanelViewWayland(PanelView *q); -+ -+ bool isCompositingActive() const; -+ -+ void setScreen(QScreen *screen); -+ void setVisibilityMode(const PanelView::VisibilityMode &mode); -+ void setPosition(const QPoint &pos); -+ void slideToLocation(const KWindowEffects::SlideFromLocation &from, -+ const QPoint &to); -+ void setConfigViewState(PlasmaQuick::ConfigView *view); -+ void setAutoHideEnabled(bool enabled); -+ -+ void themeChanged(); -+ -+private: -+ KWayland::Client::PlasmaSurface *m_plasmaSurface; -+}; -+ -+#endif // PLATFORMPANELVIEW_WAYLAND_H -diff --git a/shell/platform/platformpanelview_x11.cpp b/shell/platform/platformpanelview_x11.cpp -new file mode 100644 -index 0000000..f3258c4 ---- /dev/null -+++ b/shell/platform/platformpanelview_x11.cpp -@@ -0,0 +1,284 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * Copyright 2013 Marco Martin -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include "platformpanelview_x11.h" -+ -+#include -+ -+#include -+#include -+#include -+ -+PlatformPanelViewX11::PlatformPanelViewX11(PanelView *q) -+ : PlatformPanelView(q) -+{ -+} -+ -+void PlatformPanelViewX11::setup() -+{ -+ KWindowSystem::setOnAllDesktops(q->winId(), true); -+ KWindowSystem::setType(q->winId(), NET::Dock); -+} -+ -+bool PlatformPanelViewX11::isCompositingActive() const -+{ -+ return KWindowSystem::compositingActive(); -+} -+ -+void PlatformPanelViewX11::setVisibilityMode(const PanelView::VisibilityMode &mode) -+{ -+ if (mode == PanelView::LetWindowsCover) { -+ KWindowSystem::setState(q->winId(), NET::KeepBelow); -+ } else { -+ KWindowSystem::clearState(q->winId(), NET::KeepBelow); -+ } -+} -+ -+void PlatformPanelViewX11::setPosition(const QPoint &pos) -+{ -+ Q_UNUSED(pos); -+} -+ -+void PlatformPanelViewX11::slideToLocation(const KWindowEffects::SlideFromLocation &from, -+ const QPoint &to) -+{ -+ Q_UNUSED(to); -+ KWindowEffects::slideWindow(q->winId(), from, -1); -+} -+ -+void PlatformPanelViewX11::setConfigViewState(PlasmaQuick::ConfigView *view) -+{ -+ KWindowSystem::setState(view->winId(), NET::SkipTaskbar | NET::SkipPager); -+} -+ -+void PlatformPanelViewX11::setAutoHideEnabled(bool enabled) -+{ -+ xcb_connection_t *c = QX11Info::connection(); -+ if (!c) { -+ return; -+ } -+ -+ const QByteArray effectName = QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"); -+ xcb_intern_atom_cookie_t atomCookie = xcb_intern_atom_unchecked(c, false, effectName.length(), effectName.constData()); -+ -+ QScopedPointer atom(xcb_intern_atom_reply(c, atomCookie, NULL)); -+ -+ if (!atom) { -+ return; -+ } -+ -+ if (!enabled) { -+ xcb_delete_property(c, q->winId(), atom->atom); -+ return; -+ } -+ -+ KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge; -+ uint32_t value = 0; -+ -+ switch (q->location()) { -+ case Plasma::Types::TopEdge: -+ value = 0; -+ slideLocation = KWindowEffects::TopEdge; -+ break; -+ case Plasma::Types::RightEdge: -+ value = 1; -+ slideLocation = KWindowEffects::RightEdge; -+ break; -+ case Plasma::Types::BottomEdge: -+ value = 2; -+ slideLocation = KWindowEffects::BottomEdge; -+ break; -+ case Plasma::Types::LeftEdge: -+ value = 3; -+ slideLocation = KWindowEffects::LeftEdge; -+ break; -+ case Plasma::Types::Floating: -+ default: -+ value = 4; -+ break; -+ } -+ -+ xcb_change_property(c, XCB_PROP_MODE_REPLACE, q->winId(), atom->atom, XCB_ATOM_CARDINAL, 32, 1, &value); -+ KWindowEffects::slideWindow(q->winId(), slideLocation, -1); -+} -+ -+void PlatformPanelViewX11::updateStruts() -+{ -+ NETExtendedStrut strut; -+ -+ if (q->visibilityMode() == PanelView::NormalPanel) { -+ const QRect thisScreen = q->screen()->geometry(); -+ const QRect wholeScreen = q->screen()->virtualGeometry(); -+ -+ //Extended struts against a screen edge near to another screen are really harmful, so windows maximized under the panel is a lesser pain -+ //TODO: force "windows can cover" in those cases? -+ const int numScreens = q->corona()->numScreens(); -+ for (int i = 0; i < numScreens; ++i) { -+ if (i == q->containment()->screen()) { -+ continue; -+ } -+ -+ const QRect otherScreen = q->corona()->screenGeometry(i); -+ -+ switch (q->location()) -+ { -+ case Plasma::Types::TopEdge: -+ if (otherScreen.bottom() <= thisScreen.top()) { -+ KWindowSystem::setExtendedStrut(q->winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -+ return; -+ } -+ break; -+ case Plasma::Types::BottomEdge: -+ if (otherScreen.top() >= thisScreen.bottom()) { -+ KWindowSystem::setExtendedStrut(q->winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -+ return; -+ } -+ break; -+ case Plasma::Types::RightEdge: -+ if (otherScreen.left() >= thisScreen.right()) { -+ KWindowSystem::setExtendedStrut(q->winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -+ return; -+ } -+ break; -+ case Plasma::Types::LeftEdge: -+ if (otherScreen.right() <= thisScreen.left()) { -+ KWindowSystem::setExtendedStrut(q->winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -+ return; -+ } -+ break; -+ default: -+ return; -+ } -+ } -+ // extended struts are to the combined screen geoms, not the single screen -+ int leftOffset = thisScreen.x(); -+ int rightOffset = wholeScreen.right() - thisScreen.right(); -+ int bottomOffset = wholeScreen.bottom() - thisScreen.bottom(); -+// qDebug() << "screen l/r/b/t offsets are:" << leftOffset << rightOffset << bottomOffset << topOffset << location(); -+ int topOffset = thisScreen.top(); -+ -+ switch (q->location()) -+ { -+ case Plasma::Types::TopEdge: -+ strut.top_width = q->thickness() + topOffset; -+ strut.top_start = q->x(); -+ strut.top_end = q->x() + q->width() - 1; -+// qDebug() << "setting top edge to" << strut.top_width << strut.top_start << strut.top_end; -+ break; -+ -+ case Plasma::Types::BottomEdge: -+ strut.bottom_width = q->thickness() + bottomOffset; -+ strut.bottom_start = q->x(); -+ strut.bottom_end = q->x() + q->width() - 1; -+// qDebug() << "setting bottom edge to" << strut.bottom_width << strut.bottom_start << strut.bottom_end; -+ break; -+ -+ case Plasma::Types::RightEdge: -+ strut.right_width = q->thickness() + rightOffset; -+ strut.right_start = q->y(); -+ strut.right_end = q->y() + q->height() - 1; -+// qDebug() << "setting right edge to" << strut.right_width << strut.right_start << strut.right_end; -+ break; -+ -+ case Plasma::Types::LeftEdge: -+ strut.left_width = q->thickness() + leftOffset; -+ strut.left_start = q->y(); -+ strut.left_end = q->y() + q->height() - 1; -+// qDebug() << "setting left edge to" << strut.left_width << strut.left_start << strut.left_end; -+ break; -+ -+ default: -+ //qDebug() << "where are we?"; -+ break; -+ } -+ } -+ -+ KWindowSystem::setExtendedStrut(q->winId(), -+ strut.left_width, -+ strut.left_start, -+ strut.left_end, -+ strut.right_width, -+ strut.right_start, -+ strut.right_end, -+ strut.top_width, -+ strut.top_start, -+ strut.top_end, -+ strut.bottom_width, -+ strut.bottom_start, -+ strut.bottom_end); -+} -+ -+void PlatformPanelViewX11::themeChanged() -+{ -+ KWindowEffects::enableBlurBehind(q->winId(), true); -+ KWindowEffects::enableBackgroundContrast(q->winId(), -+ q->m_theme.backgroundContrastEnabled(), -+ q->m_theme.backgroundContrast(), -+ q->m_theme.backgroundIntensity(), -+ q->m_theme.backgroundSaturation()); -+ -+ updateMask(); -+} -+ -+void PlatformPanelViewX11::updateMask() -+{ -+ if (isCompositingActive()) { -+ q->setMask(QRegion()); -+ } else { -+ if (!q->m_background) { -+ q->m_background = new Plasma::FrameSvg(q); -+ q->m_background->setImagePath("widgets/panel-background"); -+ } -+ -+ Plasma::FrameSvg::EnabledBorders borders = Plasma::FrameSvg::AllBorders; -+ switch (q->location()) { -+ case Plasma::Types::TopEdge: -+ borders &= ~Plasma::FrameSvg::TopBorder; -+ break; -+ case Plasma::Types::LeftEdge: -+ borders &= ~Plasma::FrameSvg::LeftBorder; -+ break; -+ case Plasma::Types::RightEdge: -+ borders &= ~Plasma::FrameSvg::RightBorder; -+ break; -+ case Plasma::Types::BottomEdge: -+ borders &= ~Plasma::FrameSvg::BottomBorder; -+ break; -+ default: -+ break; -+ } -+ -+ if (q->x() <= q->screen()->geometry().x()) { -+ borders &= ~Plasma::FrameSvg::LeftBorder; -+ } -+ if (q->x() + q->width() >= q->screen()->geometry().x() + q->screen()->geometry().width()) { -+ borders &= ~Plasma::FrameSvg::RightBorder; -+ } -+ if (q->y() <= q->screen()->geometry().y()) { -+ borders &= ~Plasma::FrameSvg::TopBorder; -+ } -+ if (q->y() + q->height() >= q->screen()->geometry().y() + q->screen()->geometry().height()) { -+ borders &= ~Plasma::FrameSvg::BottomBorder; -+ } -+ q->m_background->setEnabledBorders(borders); -+ -+ q->m_background->resizeFrame(q->size()); -+ q->setMask(q->m_background->mask()); -+ } -+} -diff --git a/shell/platform/platformpanelview_x11.h b/shell/platform/platformpanelview_x11.h -new file mode 100644 -index 0000000..1769a18 ---- /dev/null -+++ b/shell/platform/platformpanelview_x11.h -@@ -0,0 +1,45 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#ifndef PLATFORMPANELVIEW_X11_H -+#define PLATFORMPANELVIEW_X11_H -+ -+#include "platformpanelview.h" -+ -+class PlatformPanelViewX11 : public PlatformPanelView -+{ -+public: -+ PlatformPanelViewX11(PanelView *q); -+ -+ void setup(); -+ -+ bool isCompositingActive() const; -+ -+ void setVisibilityMode(const PanelView::VisibilityMode &mode); -+ void setPosition(const QPoint &pos); -+ void slideToLocation(const KWindowEffects::SlideFromLocation &from, -+ const QPoint &to); -+ void setConfigViewState(PlasmaQuick::ConfigView *view); -+ void setAutoHideEnabled(bool enabled); -+ -+ void updateStruts(); -+ void themeChanged(); -+ void updateMask(); -+}; -+ -+#endif // PLATFORMPANELVIEW_X11_H -diff --git a/shell/platform/waylandinterface.cpp b/shell/platform/waylandinterface.cpp -new file mode 100644 -index 0000000..5d46501 ---- /dev/null -+++ b/shell/platform/waylandinterface.cpp -@@ -0,0 +1,73 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+#include -+#include -+ -+#include "waylandinterface.h" -+ -+using namespace KWayland::Client; -+ -+Q_GLOBAL_STATIC(WaylandInterface, s_waylandInterface) -+ -+WaylandInterface::WaylandInterface() -+ : QObject(), -+ m_plasmaEffects(Q_NULLPTR), -+ m_plasmaShell(Q_NULLPTR) -+{ -+ // Reuse QPA connection to Wayland instead of ConnectionThread, otherwise -+ // wl_surface objects from the native interface won't be recognized by -+ // the compositor -+ // TODO: Add a static method to ConnectionThread to create it using -+ // wl_display from the native interface -+ QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); -+ wl_display *display = static_cast( -+ native->nativeResourceForIntegration("display")); -+ -+ m_registry = new Registry(this); -+ connect(m_registry, &Registry::plasmaEffectsAnnounced, this, -+ [this](quint32 name, quint32 version) { -+ m_plasmaEffects = m_registry->createPlasmaEffects(name, version, m_registry); -+ } -+ ); -+ connect(m_registry, &Registry::plasmaShellAnnounced, this, -+ [this](quint32 name, quint32 version) { -+ m_plasmaShell = m_registry->createPlasmaShell(name, version, m_registry); -+ } -+ ); -+ connect(m_registry, SIGNAL(interfacesAnnounced()), this, SIGNAL(ready())); -+ m_registry->create(display); -+ m_registry->setup(); -+} -+ -+WaylandInterface *WaylandInterface::instance() -+{ -+ return s_waylandInterface(); -+} -+ -+KWayland::Client::PlasmaEffects *WaylandInterface::plasmaEffects() -+{ -+ return s_waylandInterface()->m_plasmaEffects; -+} -+ -+KWayland::Client::PlasmaShell *WaylandInterface::plasmaShell() -+{ -+ return s_waylandInterface()->m_plasmaShell; -+} -+ -+#include "moc_waylandinterface.cpp" -diff --git a/shell/platform/waylandinterface.h b/shell/platform/waylandinterface.h -new file mode 100644 -index 0000000..7915626 ---- /dev/null -+++ b/shell/platform/waylandinterface.h -@@ -0,0 +1,47 @@ -+/* -+ * Copyright 2014 Pier Luigi Fiorini -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ */ -+ -+ -+#ifndef WAYLANDINTERFACE_H -+#define WAYLANDINTERFACE_H -+ -+#include -+#include -+#include -+ -+class WaylandInterface : public QObject -+{ -+ Q_OBJECT -+public: -+ explicit WaylandInterface(); -+ -+ static WaylandInterface *instance(); -+ -+ static KWayland::Client::PlasmaEffects *plasmaEffects(); -+ static KWayland::Client::PlasmaShell *plasmaShell(); -+ -+Q_SIGNALS: -+ void ready(); -+ -+private: -+ KWayland::Client::Registry *m_registry; -+ KWayland::Client::PlasmaEffects *m_plasmaEffects; -+ KWayland::Client::PlasmaShell *m_plasmaShell; -+}; -+ -+#endif // WAYLANDINTERFACE_H -diff --git a/shell/shellmanager.cpp b/shell/shellmanager.cpp -index 766eb6f..f92a735 100644 ---- a/shell/shellmanager.cpp -+++ b/shell/shellmanager.cpp -@@ -34,6 +34,11 @@ - //#include - #include "shellcorona.h" - #include "config-workspace.h" -+#include "config-plasma.h" -+ -+#if HAVE_WAYLAND -+# include "platform/waylandinterface.h" -+#endif - - #include - -@@ -83,8 +88,15 @@ ShellManager::ShellManager() - this, &ShellManager::updateShell - ); - -+#if HAVE_WAYLAND -+ if (QGuiApplication::platformName().startsWith(QStringLiteral("wayland"))) { -+ connect(WaylandInterface::instance(), &WaylandInterface::ready, -+ this, &ShellManager::loadHandlers); -+ } -+#else - //we have to ensure this is executed after QCoreApplication::exec() - QMetaObject::invokeMethod(this, "loadHandlers", Qt::QueuedConnection); -+#endif - } - - ShellManager::~ShellManager() --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0011-fix-build-for-QT_NO_SESSIONMANAGER.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0001-fix-build-for-QT_NO_SESSIONMANAGER.patch similarity index 100% rename from recipes-kde/plasma/tier3/plasma-workspace/files/0011-fix-build-for-QT_NO_SESSIONMANAGER.patch rename to recipes-kde/plasma/tier3/plasma-workspace/files/0001-fix-build-for-QT_NO_SESSIONMANAGER.patch diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0002-Initial-Wayland-support-II.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0002-Initial-Wayland-support-II.patch deleted file mode 100644 index 79ddf684..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0002-Initial-Wayland-support-II.patch +++ /dev/null @@ -1,55 +0,0 @@ -From d811d01b610432c3ae6480883f01b7367254e2db Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Thu, 11 Dec 2014 13:54:24 +0100 -Subject: [PATCH 03/12] Initial Wayland support II -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Remove traces on ksmserver. This is necccessary for pure wayland environments. - -Signed-off-by: Andreas Müller ---- - libkworkspace/CMakeLists.txt | 6 ++++-- - libkworkspace/kworkspace.cpp | 2 ++ - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/libkworkspace/CMakeLists.txt b/libkworkspace/CMakeLists.txt -index 53ce610..b7a5348 100644 ---- a/libkworkspace/CMakeLists.txt -+++ b/libkworkspace/CMakeLists.txt -@@ -10,13 +10,15 @@ remove_definitions(-DQT_NO_CAST_TO_ASCII) - - - set(ksmserver_xml ${plasma-workspace_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml) --qt5_add_dbus_interface( kworkspace_LIB_SRCS ${ksmserver_xml} ksmserver_interface ) -+ -+if(HAVE_X11) -+ qt5_add_dbus_interface( kworkspace_LIB_SRCS ${ksmserver_xml} ksmserver_interface ) -+endif() - - set_source_files_properties(${KWIN_INTERFACE} PROPERTIES INCLUDE "interface_util.h") - - qt5_add_dbus_interface( kworkspace_LIB_SRCS ${KWIN_INTERFACE} kwin_interface ) - -- - add_library(kworkspace ${kworkspace_LIB_SRCS}) - add_library(PW::KWorkspace ALIAS kworkspace) - set_target_properties(kworkspace PROPERTIES -diff --git a/libkworkspace/kworkspace.cpp b/libkworkspace/kworkspace.cpp -index bad054a..ba3e284 100644 ---- a/libkworkspace/kworkspace.cpp -+++ b/libkworkspace/kworkspace.cpp -@@ -28,7 +28,9 @@ - #include - #include - #include // getenv() -+#if HAVE_X11 - #include -+#endif - #include - - #if HAVE_X11 --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0012-align-phonon-path.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0002-align-phonon-path.patch similarity index 100% rename from recipes-kde/plasma/tier3/plasma-workspace/files/0012-align-phonon-path.patch rename to recipes-kde/plasma/tier3/plasma-workspace/files/0002-align-phonon-path.patch diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0003-Initial-Wayland-support-III.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0003-Initial-Wayland-support-III.patch deleted file mode 100644 index 8602612b..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0003-Initial-Wayland-support-III.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 69d6878240c2b5aa680efa1cd76d0e18e5c42e7b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Thu, 11 Dec 2014 14:01:47 +0100 -Subject: [PATCH 04/12] Initial Wayland support III -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Remove traces on kwin. This is necccessary for pure wayland environments. - -Signed-off-by: Andreas Müller ---- - libkworkspace/CMakeLists.txt | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/libkworkspace/CMakeLists.txt b/libkworkspace/CMakeLists.txt -index b7a5348..b456deb 100644 ---- a/libkworkspace/CMakeLists.txt -+++ b/libkworkspace/CMakeLists.txt -@@ -17,7 +17,9 @@ endif() - - set_source_files_properties(${KWIN_INTERFACE} PROPERTIES INCLUDE "interface_util.h") - --qt5_add_dbus_interface( kworkspace_LIB_SRCS ${KWIN_INTERFACE} kwin_interface ) -+if(HAVE_X11) -+ qt5_add_dbus_interface( kworkspace_LIB_SRCS ${KWIN_INTERFACE} kwin_interface ) -+endif() - - add_library(kworkspace ${kworkspace_LIB_SRCS}) - add_library(PW::KWorkspace ALIAS kworkspace) --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0013-fix-paths-in-startkde.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0003-fix-paths-in-startkde.patch similarity index 100% rename from recipes-kde/plasma/tier3/plasma-workspace/files/0013-fix-paths-in-startkde.patch rename to recipes-kde/plasma/tier3/plasma-workspace/files/0003-fix-paths-in-startkde.patch diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0004-Initial-Wayland-support-IV.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0004-Initial-Wayland-support-IV.patch deleted file mode 100644 index 1f91a244..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0004-Initial-Wayland-support-IV.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 7e38e15ce6ed9a1b01feb243abe911287a5b0627 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Thu, 11 Dec 2014 15:33:08 +0100 -Subject: [PATCH 05/12] Initial Wayland support IV -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -don't link libkworkspace against Xau in x11-less environments - -Signed-off-by: Andreas Müller ---- - libkworkspace/CMakeLists.txt | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/libkworkspace/CMakeLists.txt b/libkworkspace/CMakeLists.txt -index b456deb..95aaeb3 100644 ---- a/libkworkspace/CMakeLists.txt -+++ b/libkworkspace/CMakeLists.txt -@@ -39,7 +39,6 @@ target_link_libraries(kworkspace - KF5::I18n - KF5::WindowSystem - KF5::Plasma -- Xau - ) - target_include_directories(kworkspace PUBLIC "$" - INTERFACE "$" ) -@@ -47,7 +46,7 @@ target_include_directories(kworkspace PUBLIC "$ -Date: Tue, 16 Dec 2014 21:02:35 +0100 -Subject: [PATCH 06/12] Initial Wayland support V -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Screensaver is part of ksmserver which is not build for x11 missing - -Signed-off-by: Andreas Müller ---- - containmentactions/contextmenu/CMakeLists.txt | 6 ++++-- - containmentactions/contextmenu/menu.cpp | 5 +++++ - runners/sessions/CMakeLists.txt | 6 ++++-- - runners/sessions/sessionrunner.cpp | 4 ++++ - 4 files changed, 17 insertions(+), 4 deletions(-) - -diff --git a/containmentactions/contextmenu/CMakeLists.txt b/containmentactions/contextmenu/CMakeLists.txt -index d85f8c6..980da6b 100644 ---- a/containmentactions/contextmenu/CMakeLists.txt -+++ b/containmentactions/contextmenu/CMakeLists.txt -@@ -11,8 +11,10 @@ set(contextmenu_SRCS - set(krunner_xml ${plasma-workspace_SOURCE_DIR}/krunner/dbus/org.kde.krunner.App.xml) - qt5_add_dbus_interface(contextmenu_SRCS ${krunner_xml} krunner_interface) - --set(screensaver_xml ${ksmserver_SOURCE_DIR}/screenlocker/dbus/org.freedesktop.ScreenSaver.xml) --qt5_add_dbus_interface(contextmenu_SRCS ${screensaver_xml} screensaver_interface) -+if(X11_FOUND) -+ set(screensaver_xml ${ksmserver_SOURCE_DIR}/screenlocker/dbus/org.freedesktop.ScreenSaver.xml) -+ qt5_add_dbus_interface(contextmenu_SRCS ${screensaver_xml} screensaver_interface) -+endif() - - - add_library(plasma_containmentactions_contextmenu MODULE ${contextmenu_SRCS}) -diff --git a/containmentactions/contextmenu/menu.cpp b/containmentactions/contextmenu/menu.cpp -index 8e0d05a..fa7f58f 100644 ---- a/containmentactions/contextmenu/menu.cpp -+++ b/containmentactions/contextmenu/menu.cpp -@@ -35,7 +35,10 @@ - - #include "kworkspace.h" - #include "krunner_interface.h" -+ -+#if HAVE_X11 - #include "screensaver_interface.h" -+#endif - - #ifdef Q_OS_WIN - #define _WIN32_WINNT 0x0500 // require NT 5.0 (win 2k pro) -@@ -199,12 +202,14 @@ void ContextMenu::lockScreen() - } - - #ifndef Q_OS_WIN -+#if HAVE_X11 - QString interface("org.freedesktop.ScreenSaver"); - org::freedesktop::ScreenSaver screensaver(interface, "/ScreenSaver", - QDBusConnection::sessionBus()); - if (screensaver.isValid()) { - screensaver.Lock(); - } -+#endif // HAVE_X11 - #else - LockWorkStation(); - #endif // !Q_OS_WIN -diff --git a/runners/sessions/CMakeLists.txt b/runners/sessions/CMakeLists.txt -index 30dbe16..7c4dcc1 100644 ---- a/runners/sessions/CMakeLists.txt -+++ b/runners/sessions/CMakeLists.txt -@@ -4,8 +4,10 @@ set(krunner_sessions_SRCS - sessionrunner.cpp - ) - --set(screensaver_xml ${ksmserver_SOURCE_DIR}/screenlocker/dbus/org.freedesktop.ScreenSaver.xml) --qt5_add_dbus_interface(krunner_sessions_SRCS ${screensaver_xml} screensaver_interface) -+if(X11_FOUND) -+ set(screensaver_xml ${ksmserver_SOURCE_DIR}/screenlocker/dbus/org.freedesktop.ScreenSaver.xml) -+ qt5_add_dbus_interface(krunner_sessions_SRCS ${screensaver_xml} screensaver_interface) -+endif() - - add_library(krunner_sessions MODULE ${krunner_sessions_SRCS}) - target_link_libraries(krunner_sessions Qt5::Widgets Qt5::DBus KF5::Runner KF5::I18n PW::KWorkspace) -diff --git a/runners/sessions/sessionrunner.cpp b/runners/sessions/sessionrunner.cpp -index 489e420..b408ff0 100644 ---- a/runners/sessions/sessionrunner.cpp -+++ b/runners/sessions/sessionrunner.cpp -@@ -26,7 +26,9 @@ - - #include "kworkspace.h" - -+#if HAVE_X11 - #include "screensaver_interface.h" -+#endif - - K_EXPORT_PLASMA_RUNNER(calculatorrunner, SessionRunner) - -@@ -271,12 +273,14 @@ void SessionRunner::run(const Plasma::RunnerContext &context, const Plasma::Quer - - void SessionRunner::lock() - { -+#if HAVE_X11 - QString interface("org.freedesktop.ScreenSaver"); - org::freedesktop::ScreenSaver screensaver(interface, "/ScreenSaver", - QDBusConnection::sessionBus()); - if (screensaver.isValid()) { - screensaver.Lock(); - } -+#endif - } - - #include "sessionrunner.moc" --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0015-startkde-fix-path-for-start_kdeinit_wrapper.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0005-startkde-fix-path-for-start_kdeinit_wrapper.patch similarity index 100% rename from recipes-kde/plasma/tier3/plasma-workspace/files/0015-startkde-fix-path-for-start_kdeinit_wrapper.patch rename to recipes-kde/plasma/tier3/plasma-workspace/files/0005-startkde-fix-path-for-start_kdeinit_wrapper.patch diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0006-HACK-enable-task_wayland.cpp-stub-for-non-x11-builds.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0006-HACK-enable-task_wayland.cpp-stub-for-non-x11-builds.patch deleted file mode 100644 index 3a77f085..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0006-HACK-enable-task_wayland.cpp-stub-for-non-x11-builds.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 12cf21754b2ea41b13930943d6065a907dbd0a21 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Thu, 11 Dec 2014 15:15:43 +0100 -Subject: [PATCH 07/12] HACK: enable task_wayland.cpp stub for non x11 builds - to make linker happy -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Andreas Müller ---- - libtaskmanager/CMakeLists.txt | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/libtaskmanager/CMakeLists.txt b/libtaskmanager/CMakeLists.txt -index 640f1fb..b3ce55a 100644 ---- a/libtaskmanager/CMakeLists.txt -+++ b/libtaskmanager/CMakeLists.txt -@@ -31,15 +31,11 @@ set(taskmanager_LIB_SRCS - - ki18n_wrap_ui(taskmanager_LIB_SRCS launcherconfig.ui launcherproperties.ui) - --if(WIN32) -- set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_win.cpp) --endif() --if(HAVE_X11 AND NOT WIN32) -+if(HAVE_X11) - set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_x11.cpp) -+else() -+ set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_wayland.cpp) - endif() --#if(HAVE_WAYLAND) --# set(taskmanager_LIB_SRCS ${taskmanager_LIB_SRCS} task_wayland.cpp) --#endif() - - add_library(taskmanager ${taskmanager_LIB_SRCS}) - add_library(PW::LibTaskManager ALIAS taskmanager) --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0007-Do-check-for-kwin-only-in-case-X11-was-found.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0007-Do-check-for-kwin-only-in-case-X11-was-found.patch deleted file mode 100644 index cd14f7b7..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0007-Do-check-for-kwin-only-in-case-X11-was-found.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 5133618013e0806e709a123e1f3bc20c8e51afc5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Thu, 11 Dec 2014 13:37:36 +0100 -Subject: [PATCH 02/12] Do check for kwin only in case X11 was found -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Andreas Müller ---- - CMakeLists.txt | 49 +++++++++++++++++++++++++++---------------------- - 1 file changed, 27 insertions(+), 22 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c7da3e7..7cb7522 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23,8 +23,7 @@ find_package(KF5 5.0.93 REQUIRED COMPONENTS Screen) - # Baloo has a different version scheme than KF5 for now - find_package(KF5 5.1 REQUIRED COMPONENTS Baloo) - find_package(KF5TextEditor) --find_package(KWinDBusInterface CONFIG REQUIRED) --find_package(KF5WebKit) -+ - - include(KDEInstallDirs) - include(KDECMakeSettings) -@@ -36,6 +35,32 @@ include(WriteBasicConfigVersionFile) - include(CheckIncludeFiles) - include(FeatureSummary) - -+find_package(X11) -+set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" -+ URL "http://www.x.org" -+ TYPE OPTIONAL -+ PURPOSE "Required for building the X11 based workspace") -+ -+if(X11_FOUND) -+ find_package(XCB MODULE REQUIRED COMPONENTS XCB KEYSYMS) -+ set_package_properties(XCB PROPERTIES TYPE REQUIRED) -+ if(NOT X11_SM_FOUND) -+ message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") -+ endif(NOT X11_SM_FOUND) -+ -+ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) -+endif() -+ -+if(X11_FOUND AND XCB_XCB_FOUND) -+ set(HAVE_X11 1) -+endif() -+ -+if(HAVE_X11) -+ find_package(KWinDBusInterface CONFIG REQUIRED) -+endif() -+ -+find_package(KF5WebKit) -+ - find_package(Qt5WebKitWidgets ${QT_MIN_VERSION} CONFIG) - - set_package_properties(Qt5WebKitWidgets PROPERTIES -@@ -64,26 +89,6 @@ set_package_properties(dbusmenu-qt5 PROPERTIES DESCRIPTION "Support for notifica - TYPE OPTIONAL - ) - --find_package(X11) --set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" -- URL "http://www.x.org" -- TYPE OPTIONAL -- PURPOSE "Required for building the X11 based workspace") -- --if(X11_FOUND) -- find_package(XCB MODULE REQUIRED COMPONENTS XCB KEYSYMS) -- set_package_properties(XCB PROPERTIES TYPE REQUIRED) -- if(NOT X11_SM_FOUND) -- message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") -- endif(NOT X11_SM_FOUND) -- -- find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) --endif() -- --if(X11_FOUND AND XCB_XCB_FOUND) -- set(HAVE_X11 1) --endif() -- - find_package(KF5Wayland CONFIG) - set_package_properties(KF5Wayland PROPERTIES - TYPE REQUIRED --- -1.8.3.1 diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0008-Stub-down-sessionrunner-in-x11-less-environments.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0008-Stub-down-sessionrunner-in-x11-less-environments.patch deleted file mode 100644 index 2b3acdb6..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0008-Stub-down-sessionrunner-in-x11-less-environments.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 723e5d63a56f83fdc341f8f290df0453d7756ed8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Tue, 16 Dec 2014 22:18:12 +0100 -Subject: [PATCH 09/12] Stub down sessionrunner in x11-less environments -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Andreas Müller ---- - runners/sessions/sessionrunner.cpp | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/runners/sessions/sessionrunner.cpp b/runners/sessions/sessionrunner.cpp -index b408ff0..a92ed51 100644 ---- a/runners/sessions/sessionrunner.cpp -+++ b/runners/sessions/sessionrunner.cpp -@@ -135,6 +135,7 @@ void SessionRunner::match(Plasma::RunnerContext &context) - return; - } - -+#if HAVE_X11 - // first compare with SESSIONS. this must *NOT* be translated (i18n) - // as it is used as an internal command trigger (e.g. via d-bus), - // not as a user supplied query. and yes, "Ugh, magic strings" -@@ -211,6 +212,7 @@ void SessionRunner::match(Plasma::RunnerContext &context) - } - - context.addMatches(matches); -+#endif HAVE_X11 - } - - void SessionRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) -@@ -242,6 +244,7 @@ void SessionRunner::run(const Plasma::RunnerContext &context, const Plasma::Quer - } - } - -+#if HAVE_X11 - if (!match.data().toString().isEmpty()) { - dm.lockSwitchVT(match.data().toString().toInt()); - return; -@@ -269,6 +272,12 @@ void SessionRunner::run(const Plasma::RunnerContext &context, const Plasma::Quer - - lock(); - dm.startReserve(); -+#else -+ QMessageBox::warning( -+ 0, -+ "Warning - New Session", -+ "No session support yet in non X11 environments."); -+#endif // HAVE_X11 - } - - void SessionRunner::lock() --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0009-dataengines-mouse-fix-build-in-X11-less-environments.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0009-dataengines-mouse-fix-build-in-X11-less-environments.patch deleted file mode 100644 index 056d2944..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0009-dataengines-mouse-fix-build-in-X11-less-environments.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b3c1c404169a768dc108b835056405404eff0bea Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Wed, 28 Jan 2015 11:14:17 +0100 -Subject: [PATCH] dataengines/mouse: fix build in X11-less environments -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Andreas Müller ---- - dataengines/mouse/CMakeLists.txt | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/dataengines/mouse/CMakeLists.txt b/dataengines/mouse/CMakeLists.txt -index b744a6c..e9d56a3 100644 ---- a/dataengines/mouse/CMakeLists.txt -+++ b/dataengines/mouse/CMakeLists.txt -@@ -11,16 +11,21 @@ endif () - add_library(plasma_engine_mouse MODULE ${mouse_engine_SRCS}) - target_link_libraries(plasma_engine_mouse - Qt5::Widgets -- Qt5::X11Extras - KF5::Plasma - KF5::WindowSystem -- ${X11_LIBRARIES} - ) - - if (X11_Xfixes_FOUND) - target_link_libraries(plasma_engine_mouse ${X11_Xfixes_LIB}) - endif () - -+if (X11_FOUND) -+ target_link_libraries(plasma_engine_mouse -+ Qt5::X11Extras -+ ${X11_LIBRARIES} -+ ) -+endif () -+ - kcoreaddons_desktop_to_json(plasma_engine_mouse plasma-dataengine-mouse.desktop) - - install(TARGETS plasma_engine_mouse DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine) --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/files/0010-fix-missuse-of-HAVE_X11.patch b/recipes-kde/plasma/tier3/plasma-workspace/files/0010-fix-missuse-of-HAVE_X11.patch deleted file mode 100644 index 1560db59..00000000 --- a/recipes-kde/plasma/tier3/plasma-workspace/files/0010-fix-missuse-of-HAVE_X11.patch +++ /dev/null @@ -1,70 +0,0 @@ -From e75ca437349155a3a40eea7e688657065efc777d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Wed, 28 Jan 2015 10:39:36 +0100 -Subject: [PATCH] fix missuse of HAVE_X11 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -fixes in X11-less environments: - -| shell/scripting/appinterface.cpp:41:22: fatal error: X11/Xlib.h: No such file or directory - -Signed-off-by: Andreas Müller ---- - shell/scripting/appinterface.cpp | 4 ++-- - soliduiserver/soliduiserver.cpp | 2 +- - startkde/kcminit/main.cpp | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/shell/scripting/appinterface.cpp b/shell/scripting/appinterface.cpp -index 4153c9b..6be429e 100644 ---- a/shell/scripting/appinterface.cpp -+++ b/shell/scripting/appinterface.cpp -@@ -37,7 +37,7 @@ - #include - #endif - --#ifdef HAVE_X11 -+#if HAVE_X11 - #include - #include - #endif -@@ -137,7 +137,7 @@ int AppInterface::multiheadScreen() const - { - int id = -1; - --#ifdef HAVE_X11 -+#if HAVE_X11 - if (multihead()) { - // with multihead, we "lie" and say that screen 0 is the default screen, in fact, we pretend - // we have only one screen at all -diff --git a/soliduiserver/soliduiserver.cpp b/soliduiserver/soliduiserver.cpp -index 2af2555..1afe2d8 100644 ---- a/soliduiserver/soliduiserver.cpp -+++ b/soliduiserver/soliduiserver.cpp -@@ -222,7 +222,7 @@ void SolidUiServer::reparentDialog(QWidget *dialog, WId wId, const QString &appI - - KWindowSystem::setMainWindow(dialog, wId); // correct, set dialog parent - --#ifdef HAVE_X11 -+#if HAVE_X11 - if (modal) { - KWindowSystem::setState(dialog->winId(), NET::Modal); - } else { -diff --git a/startkde/kcminit/main.cpp b/startkde/kcminit/main.cpp -index 4724323..0fa2dda 100644 ---- a/startkde/kcminit/main.cpp -+++ b/startkde/kcminit/main.cpp -@@ -163,7 +163,7 @@ KCMInit::KCMInit( KCmdLineArgs* args ) - // This key has no GUI apparently - KConfig _config( "kcmdisplayrc" ); - KConfigGroup config(&_config, "X11"); --#ifdef HAVE_X11 -+#if HAVE_X11 - bool multihead = !config.readEntry( "disableMultihead", false) && - (QGuiApplication::screens().count() > 1); - #else --- -1.8.3.1 - diff --git a/recipes-kde/plasma/tier3/plasma-workspace/plasma-workspace.bb b/recipes-kde/plasma/tier3/plasma-workspace/plasma-workspace.bb index 3e72eec0..29ade48b 100644 --- a/recipes-kde/plasma/tier3/plasma-workspace/plasma-workspace.bb +++ b/recipes-kde/plasma/tier3/plasma-workspace/plasma-workspace.bb @@ -26,7 +26,9 @@ DEPENDS += " \ kdewebkit \ ktextwidgets \ kdelibs4support \ + kxmlrpcclient \ kcrash \ + networkmanager-qt \ libksysguard \ libkscreen \ kwayland \ @@ -35,36 +37,18 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "93b4b7e187035635982d3099ba2c8d79" -SRC_URI[sha256sum] = "b174136ab7e5ec7190d5ad872e7334245b2e59c2a93e5f53666d155744a90572" +SRC_URI[md5sum] = "4085a9bdd87706beeccfcc7dd09d5b85" +SRC_URI[sha256sum] = "95f5b2319ca0c63f883e5350760d234eb2ee1a57f21e612f9ac35b0ded467316" SRC_URI += " \ - file://0001-Initial-Wayland-support.patch \ - file://0002-Initial-Wayland-support-II.patch \ - file://0003-Initial-Wayland-support-III.patch \ - file://0004-Initial-Wayland-support-IV.patch \ - file://0005-Initial-Wayland-support-V.patch \ + file://0001-fix-build-for-QT_NO_SESSIONMANAGER.patch \ \ - file://0006-HACK-enable-task_wayland.cpp-stub-for-non-x11-builds.patch \ - \ - file://0007-Do-check-for-kwin-only-in-case-X11-was-found.patch \ - file://0008-Stub-down-sessionrunner-in-x11-less-environments.patch \ - file://0009-dataengines-mouse-fix-build-in-X11-less-environments.patch \ - file://0010-fix-missuse-of-HAVE_X11.patch \ - \ - file://0011-fix-build-for-QT_NO_SESSIONMANAGER.patch \ - \ - file://0012-align-phonon-path.patch \ - file://0013-fix-paths-in-startkde.patch \ - file://0014-startkde-add-meta-qt5-standard-binary-path-to-PATH.patch \ - file://0015-startkde-fix-path-for-start_kdeinit_wrapper.patch \ + file://0002-align-phonon-path.patch \ + file://0003-fix-paths-in-startkde.patch \ + file://0004-startkde-add-meta-qt5-standard-binary-path-to-PATH.patch \ + file://0005-startkde-fix-path-for-start_kdeinit_wrapper.patch \ " -# Notes on patches -# 0001 stolen from http://quickgit.kde.org/?p=clones%2Fplasma-workspace%2Fpierluigifiorini%2Fwayland.git&a=shortlog&h=8ce24d3c1cc9b3fe2ced19e7dec8c24c7ddc1173 -# 0002-0006 are neccessary for x11-less wayland -# 0007 taskmanager stub either X11 or wayland - # cross libs / headers CMAKE_ALIGN_SYSROOT[1] = "LibKWorkspace, -S${libdir}/lib, -S${STAGING_LIBDIR}/lib" CMAKE_ALIGN_SYSROOT[2] = "LibKWorkspace, -S${includedir}, -S${STAGING_INCDIR}" diff --git a/recipes-kde/plasma/untier/breeze/breeze.bb b/recipes-kde/plasma/untier/breeze/breeze.bb index ed411288..220b3e19 100644 --- a/recipes-kde/plasma/untier/breeze/breeze.bb +++ b/recipes-kde/plasma/untier/breeze/breeze.bb @@ -21,13 +21,14 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "eab754e5ad4ee9f7e83bf6bbc40815c3" -SRC_URI[sha256sum] = "5b480d0fd8f277796e7a67d5ac4e255c4479909e5aa0b283e4e0aa21035e8460" +SRC_URI[md5sum] = "1fcd000caca4ba4255c2ded1857f6786" +SRC_URI[sha256sum] = "93ed542922847f6be9684aff21c627d5cab1c1e14116f24ef360ae23095fb989" FILES_${PN} += " \ ${datadir}/color-schemes \ ${datadir}/icons \ ${datadir}/kconf_update \ + ${datadir}/kservices5 \ ${datadir}/kstyle \ ${datadir}/QtCurve \ ${datadir}/wallpapers \ diff --git a/recipes-kde/plasma/untier/kde-cli-tools/kde-cli-tools.bb b/recipes-kde/plasma/untier/kde-cli-tools/kde-cli-tools.bb index b0cb1b2b..cd1b1a9e 100644 --- a/recipes-kde/plasma/untier/kde-cli-tools/kde-cli-tools.bb +++ b/recipes-kde/plasma/untier/kde-cli-tools/kde-cli-tools.bb @@ -21,8 +21,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "45d17f187fea978d2892472c6a52bd5e" -SRC_URI[sha256sum] = "f5038119e5e67b1b1086e46c9e03a754a3393193d5149f67f2a433e24aeca767" +SRC_URI[md5sum] = "49908719c3243cdf6a424ed9eae3dc09" +SRC_URI[sha256sum] = "c7a63778f8595e64099c9f6e8b72bf94d8d224a60d77e8f4910cbe993023278a" # do not move so-libs to -dev package FILES_SOLIBSDEV = "" diff --git a/recipes-kde/plasma/untier/kde-gtk-config/kde-gtk-config.bb b/recipes-kde/plasma/untier/kde-gtk-config/kde-gtk-config.bb index 4c3f3987..507ae362 100644 --- a/recipes-kde/plasma/untier/kde-gtk-config/kde-gtk-config.bb +++ b/recipes-kde/plasma/untier/kde-gtk-config/kde-gtk-config.bb @@ -19,8 +19,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "04bf3159d967f4f52ef92c125645197c" -SRC_URI[sha256sum] = "0b171071cfccb1812a84f97646cb5370bb66de255b29039c6d2cffcc4cedd043" +SRC_URI[md5sum] = "aab58003cc7011ddfdb6d93803327fc8" +SRC_URI[sha256sum] = "8ec14b07880fdb9029e29439e83ab365cda5db3d0fec6219e00a9433569ef2e8" SRC_URI += "file://0001-fix-for-gtk2-only-and-gtk3-only-environments.patch" diff --git a/recipes-kde/plasma/untier/kdeplasma-addons/kdeplasma-addons.bb b/recipes-kde/plasma/untier/kdeplasma-addons/kdeplasma-addons.bb index a2e8ba4d..5e11986b 100644 --- a/recipes-kde/plasma/untier/kdeplasma-addons/kdeplasma-addons.bb +++ b/recipes-kde/plasma/untier/kdeplasma-addons/kdeplasma-addons.bb @@ -21,19 +21,21 @@ DEPENDS += " \ sonnet \ kunitconversion \ kdelibs4support \ + kross \ + knewstuff \ \ ${@bb.utils.contains("DISTRO_FEATURES", "x11", "virtual/xserver qtx11extras", "", d)} \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "d172b2438d751f7b39ddffb47aacbfc3" -SRC_URI[sha256sum] = "f893ad77dea6b9fa08e4eeab57d47370795ae5c39826c51c9e492a4adf5dff7f" +SRC_URI[md5sum] = "f72a71c6f52ae05e0040d9f2de5bc8ae" +SRC_URI[sha256sum] = "9472cf37d0f85fd1446e8f4e73fc7d221330c03241585cc549d28c52b1460682" SRC_URI += "file://0001-showdesktop-do-check-HAVE_X11-correctly.patch" FILES_${PN} += " \ ${datadir}/kwin \ - ${datadir}/kservices5 \ + ${datadir}/k*5 \ ${datadir}/plasma \ ${datadir}/icons \ \ @@ -43,6 +45,6 @@ FILES_${PN} += " \ FILES_${PN}-dbg += " \ ${libdir}/plugins/.debug \ - ${libdir}/plugins/plasma/dataengine/.debug \ + ${libdir}/plugins/*/*/.debug \ ${libdir}/qml/org/kde/plasma/private/*/.debug \ " diff --git a/recipes-kde/plasma/untier/khelpcenter/khelpcenter.bb b/recipes-kde/plasma/untier/khelpcenter/khelpcenter.bb index b9555f83..37e0ea91 100644 --- a/recipes-kde/plasma/untier/khelpcenter/khelpcenter.bb +++ b/recipes-kde/plasma/untier/khelpcenter/khelpcenter.bb @@ -17,8 +17,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "e1fe62c0df75e99cdd91de86709727ca" -SRC_URI[sha256sum] = "07b5cff0afb9b7f98dee727a315365625d34d39a5611f37a1c0f62ff87e33264" +SRC_URI[md5sum] = "dd2e8097fffd3eb46812810e2e28e66b" +SRC_URI[sha256sum] = "7102a2969153e9a929fdbeaa53b7aab0b4f8a981f97071f119d0d62fd80267fe" SRC_URI += " \ file://0001-fix-build-for-qtbase-without-session-management.patch \ diff --git a/recipes-kde/plasma/untier/khotkeys/khotkeys.bb b/recipes-kde/plasma/untier/khotkeys/khotkeys.bb index 7ab93dc7..78967653 100644 --- a/recipes-kde/plasma/untier/khotkeys/khotkeys.bb +++ b/recipes-kde/plasma/untier/khotkeys/khotkeys.bb @@ -24,8 +24,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "68a9500c5e58ddfa312ef49faaaa18c3" -SRC_URI[sha256sum] = "9275a2f535a63087280763ad5ebb9d9642a4da141e1fb753c3df090a740fe599" +SRC_URI[md5sum] = "7911ebdb88f415510ef480ca1faa147f" +SRC_URI[sha256sum] = "443510037bdd51b177efa273bfb34c8c3d40d293944bec420fab0b7acc3ebea5" FILES_${PN} += " \ ${datadir}/kservices5 \ diff --git a/recipes-kde/plasma/untier/kinfocenter/kinfocenter.bb b/recipes-kde/plasma/untier/kinfocenter/kinfocenter.bb index 94d82557..33fc2137 100644 --- a/recipes-kde/plasma/untier/kinfocenter/kinfocenter.bb +++ b/recipes-kde/plasma/untier/kinfocenter/kinfocenter.bb @@ -34,17 +34,16 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "0cf225caaea032301670a1c11240233a" -SRC_URI[sha256sum] = "74629647897a6ff7d2bae45d1d8c1c473ed2c9a65cc7877b042114e1e81bb02b" +SRC_URI[md5sum] = "69c3b7d22f80994aaa603ee7563bd63b" +SRC_URI[sha256sum] = "3cb666bc974d26e269cf07f050049b47bb523530e14ab60802ee0c1902b7f60b" SRC_URI += "file://0001-fix-build-in-x11-less-environments.patch" FILES_${PN} += " \ ${datadir}/kcmusb \ ${datadir}/desktop-directories \ - ${datadir}/kservices5 \ - ${datadir}/kxmlgui5 \ - ${datadir}/kservicetypes5 \ + ${datadir}/k*5 \ + ${datadir}/kpackage \ \ ${libdir}/plugins \ " diff --git a/recipes-kde/plasma/untier/kio-extras/kio-extras.bb b/recipes-kde/plasma/untier/kio-extras/kio-extras.bb index 1fbb0ad8..acda9c08 100644 --- a/recipes-kde/plasma/untier/kio-extras/kio-extras.bb +++ b/recipes-kde/plasma/untier/kio-extras/kio-extras.bb @@ -42,8 +42,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "c63b83ca7df980875a8827bdb936793d" -SRC_URI[sha256sum] = "4b5127239283da14a83fd21896f99767cec7f8f7818aa19ff960c57fec7fd7a3" +SRC_URI[md5sum] = "cac226ba36f31c0f755482c73c820685" +SRC_URI[sha256sum] = "0e523e936eebc4f19a7f65ab48709055ea4ccdfda2853059a826dca61859ce58" FILES_${PN} += " \ ${datadir}/kio_bookmarks \ diff --git a/recipes-kde/plasma/untier/kmenuedit/kmenuedit.bb b/recipes-kde/plasma/untier/kmenuedit/kmenuedit.bb index f138fe99..7b036b23 100644 --- a/recipes-kde/plasma/untier/kmenuedit/kmenuedit.bb +++ b/recipes-kde/plasma/untier/kmenuedit/kmenuedit.bb @@ -23,8 +23,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "e99dbc3e15f9d71982b1daaceb28bb72" -SRC_URI[sha256sum] = "7c171db6106a38788b761966264cda6a198c0e1e1daf21d2ed5bfa4384949843" +SRC_URI[md5sum] = "fdaedd50d6f1f26205df1fe08b12c56d" +SRC_URI[sha256sum] = "3255a5170279e5d74b8d0f2f2b3371aee855b92f87dd20ed742a613908a0ff4b" # do not move so-libs to -dev package FILES_SOLIBSDEV = "" diff --git a/recipes-kde/plasma/untier/kscreen/kscreen.bb b/recipes-kde/plasma/untier/kscreen/kscreen.bb index 990b949d..b3a1e97b 100644 --- a/recipes-kde/plasma/untier/kscreen/kscreen.bb +++ b/recipes-kde/plasma/untier/kscreen/kscreen.bb @@ -21,8 +21,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "22b7c53da83bc103d8762565216e2c95" -SRC_URI[sha256sum] = "ec60ff60c6ff268117a570bffd471d3df7aadcd97bcec0a60041846b0820e355" +SRC_URI[md5sum] = "fa55cc44387fc83bc4600a438b61d372" +SRC_URI[sha256sum] = "58c72697a0a3fbf28f605bd6c43c97e33d5b0b31be0331838ae8cffc35a638b5" FILES_${PN} += " \ ${datadir}/kcm_kscreen \ diff --git a/recipes-kde/plasma/untier/ksshaskpass/ksshaskpass.bb b/recipes-kde/plasma/untier/ksshaskpass/ksshaskpass.bb index 15b7ce74..722bdf52 100644 --- a/recipes-kde/plasma/untier/ksshaskpass/ksshaskpass.bb +++ b/recipes-kde/plasma/untier/ksshaskpass/ksshaskpass.bb @@ -19,5 +19,5 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "81ad5f60de97b537abecff1e6c2e139d" -SRC_URI[sha256sum] = "f2baa99177f59b528205628deda962a419c9a73c66a5cc5734ca91410bbe4a14" +SRC_URI[md5sum] = "8104b22a1d2a1f9c26f19a81489bde7d" +SRC_URI[sha256sum] = "a4286a659f27169d509e141c83e1a250de3f3fc4741c68f021b05b384cb0f3b8" diff --git a/recipes-kde/plasma/untier/ksysguard/ksysguard.bb b/recipes-kde/plasma/untier/ksysguard/ksysguard.bb index 5cc88f51..ddb881b2 100644 --- a/recipes-kde/plasma/untier/ksysguard/ksysguard.bb +++ b/recipes-kde/plasma/untier/ksysguard/ksysguard.bb @@ -24,8 +24,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "7ab17df276ede1a2ced54c0dcdaa6127" -SRC_URI[sha256sum] = "52d4b5b653dacbcd67770376fc35b9e0155c7a9edad9634dd8a0fe0497fce26b" +SRC_URI[md5sum] = "4e0d312a32fd528cc7fb06b2e3ae1180" +SRC_URI[sha256sum] = "919f8944f870151ec657372ea186d34333da6df621b26fc195c23ed6a9d8e25f" # do not move so-libs to -dev package FILES_SOLIBSDEV = "" diff --git a/recipes-kde/plasma/untier/kwayland/files/0001-CMakeLists.txt-add-pkg-config-as-fallback-for-Waylan.patch b/recipes-kde/plasma/untier/kwayland/files/0001-CMakeLists.txt-add-pkg-config-as-fallback-for-Waylan.patch deleted file mode 100644 index 8d116ab6..00000000 --- a/recipes-kde/plasma/untier/kwayland/files/0001-CMakeLists.txt-add-pkg-config-as-fallback-for-Waylan.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ec3ac36c761195cdc9f5bc03acb0baf1c0652212 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Fri, 21 Nov 2014 08:39:28 +0100 -Subject: [PATCH 1/4] CMakeLists.txt: add pkg-config as fallback for Wayland - lacking cmake-files -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -fixes: - -| -- The following REQUIRED packages have not been found: -| -| * Wayland (required version >= 1.3) , C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients , - -Upstream-Status: Submitted [1] - -[1] https://bugs.kde.org/show_bug.cgi?id=341149 - -Signed-off-by: Andreas Müller ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 22edaa3..93fbaef 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -28,6 +28,7 @@ ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KWAYLAND - set(REQUIRED_QT_VERSION 5.3.0) - find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) - -+find_package(PkgConfig) - find_package(Wayland 1.3 COMPONENTS Client Server) - set_package_properties(Wayland PROPERTIES - TYPE REQUIRED --- -1.8.3.1 - diff --git a/recipes-kde/plasma/untier/kwayland/files/0001-do-not-perform-runtime-tests.patch b/recipes-kde/plasma/untier/kwayland/files/0001-do-not-perform-runtime-tests.patch new file mode 100644 index 00000000..94fcd59c --- /dev/null +++ b/recipes-kde/plasma/untier/kwayland/files/0001-do-not-perform-runtime-tests.patch @@ -0,0 +1,30 @@ +From da4f66eb232ab3b9dfc2e8c294358641d3ef1348 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= +Date: Tue, 28 Apr 2015 14:38:24 +0200 +Subject: [PATCH] do not perform runtime tests +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Andreas Müller +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed3d185..08c56b8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,7 +51,6 @@ if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") + endif() + add_subdirectory(src) + add_subdirectory(autotests) +-add_subdirectory(tests) + + # create a Config.cmake and a ConfigVersion.cmake file and install them + set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Wayland") +-- +1.9.3 + diff --git a/recipes-kde/plasma/untier/kwayland/kwayland.bb b/recipes-kde/plasma/untier/kwayland/kwayland.bb index 2293fece..9dff6212 100644 --- a/recipes-kde/plasma/untier/kwayland/kwayland.bb +++ b/recipes-kde/plasma/untier/kwayland/kwayland.bb @@ -4,22 +4,15 @@ LIC_FILES_CHKSUM = " \ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \ " -inherit kde-base cmake-lib - -SRC_URI += " \ - file://0001-CMakeLists.txt-add-pkg-config-as-fallback-for-Waylan.patch \ - file://0002-PlasmaShell-and-PlasmaSurface-interfaces.patch \ - file://0003-PlasmaEffects-interface.patch \ - file://0004-Server-side-interface.patch \ -" - -# TODO come back to mainline -SRCREV = "bc9ab6731700eabf17e1b193d13c904f68f7ebe0" -S = "${WORKDIR}/git" -PV = "5.1.90+git${SRCPV}" +inherit kde-plasma cmake-lib DEPENDS += "wayland wayland-native" +PV = "${PLASMA_VERSION}" +SRC_URI[md5sum] = "ab9f358c68470f41732470b90427c5e8" +SRC_URI[sha256sum] = "99598a9fd17d9e79f69646f0ac32e6d4fb0c8aa09da58c886cca22332de41dbe" +SRC_URI += "file://0001-do-not-perform-runtime-tests.patch" + CMAKE_ALIGN_SYSROOT[1] = "KF5Wayland, -S${libdir}/lib, -S${STAGING_LIBDIR}/lib" CMAKE_ALIGN_SYSROOT[2] = "KF5Wayland, -S${includedir}, -S${STAGING_INCDIR}" diff --git a/recipes-kde/plasma/untier/kwin/files/0001-fix-build-for-qtbase-without-session-management.patch b/recipes-kde/plasma/untier/kwin/files/0001-fix-build-for-qtbase-without-session-management.patch index f991b618..3d44109f 100644 --- a/recipes-kde/plasma/untier/kwin/files/0001-fix-build-for-qtbase-without-session-management.patch +++ b/recipes-kde/plasma/untier/kwin/files/0001-fix-build-for-qtbase-without-session-management.patch @@ -16,7 +16,7 @@ diff --git a/main.cpp b/main.cpp index 44d8c49..0cb9e44 100644 --- a/main.cpp +++ b/main.cpp -@@ -360,7 +360,13 @@ void Application::createWorkspace() +@@ -372,7 +372,13 @@ void Application::createWorkspace() // critical startup section where x errors cause kwin to abort. // create workspace. @@ -27,10 +27,10 @@ index 44d8c49..0cb9e44 100644 +#else + false +#endif -+ ); ++ ); + emit workspaceCreated(); } - void Application::createAtoms() diff --git a/workspace.cpp b/workspace.cpp index 7cbe81e..66c603b 100644 --- a/workspace.cpp diff --git a/recipes-kde/plasma/untier/kwin/files/0002-Add-X11-less-support-for-pure-wayland-environments.patch b/recipes-kde/plasma/untier/kwin/files/0002-Add-X11-less-support-for-pure-wayland-environments.patch deleted file mode 100644 index 0cbd9a83..00000000 --- a/recipes-kde/plasma/untier/kwin/files/0002-Add-X11-less-support-for-pure-wayland-environments.patch +++ /dev/null @@ -1,148 +0,0 @@ -From f72c60cb99105556969c06a1008c2708b9d07da3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Wed, 10 Dec 2014 17:04:24 +0100 -Subject: [PATCH] Add X11-less support for pure wayland environments -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Upstream-Status: Pending - -Signed-off-by: Andreas Müller ---- - CMakeLists.txt | 82 ++++++++++++++++++++++++++++++++++------------------------ - 1 file changed, 48 insertions(+), 34 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4a3e547..288b072 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,7 +25,6 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS - Script - UiTools - Widgets -- X11Extras - ) - - find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET) -@@ -150,35 +149,40 @@ set_package_properties(XKB PROPERTIES - find_package(X11) - set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" - URL "http://www.x.org" -- TYPE REQUIRED -+ TYPE OPTIONAL - ) - --# All the required XCB components --find_package(XCB -- REQUIRED COMPONENTS -- XCB -- XFIXES -- DAMAGE -- COMPOSITE -- SHAPE -- SYNC -- RENDER -- RANDR -- KEYSYMS -- IMAGE -- SHM -- XTEST -- GLX -- OPTIONAL_COMPONENTS -- ICCCM --) --set_package_properties(XCB PROPERTIES TYPE REQUIRED) -+set(HAVE_X11 ${X11_FOUND}) -+ -+if(HAVE_X11) -+ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) -+ # All the required XCB components -+ find_package(XCB -+ REQUIRED COMPONENTS -+ XCB -+ XFIXES -+ DAMAGE -+ COMPOSITE -+ SHAPE -+ SYNC -+ RENDER -+ RANDR -+ KEYSYMS -+ IMAGE -+ SHM -+ XTEST -+ GLX -+ OPTIONAL_COMPONENTS -+ ICCCM -+ ) -+ set_package_properties(XCB PROPERTIES TYPE REQUIRED) - --# and the optional XCB dependencies --if (XCB_ICCCM_VERSION VERSION_LESS "0.4") -- set(XCB_ICCCM_FOUND FALSE) -+ # and the optional XCB dependencies -+ if (XCB_ICCCM_VERSION VERSION_LESS "0.4") -+ set(XCB_ICCCM_FOUND FALSE) -+ endif() -+ add_feature_info("XCB-ICCCM" XCB_ICCCM_FOUND "Required for building test applications for KWin") - endif() --add_feature_info("XCB-ICCCM" XCB_ICCCM_FOUND "Required for building test applications for KWin") - - feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) - -@@ -438,9 +442,12 @@ set(kwin_QT_LIBS - Qt5::DBus - Qt5::Quick - Qt5::Script -- Qt5::X11Extras - ) - -+if(HAVE_X11) -+ set(kwin_QT_LIBS Qt5::X11Extras) -+endif() -+ - set(kwin_KDE_LIBS - KF5::ConfigCore - KF5::CoreAddons -@@ -504,10 +511,15 @@ set(kwinLibs - ${kwin_OWN_LIBS} - ${kwin_QT_LIBS} - ${kwin_KDE_LIBS} -- ${kwin_XLIB_LIBS} -- ${kwin_XCB_LIBS} - ) - -+if(HAVE_X11) -+ set(kwinLibs -+ ${kwin_XLIB_LIBS} -+ ${kwin_XCB_LIBS} -+ ) -+endif() -+ - if(HAVE_WAYLAND) - set(kwinLibs ${kwinLibs} ${kwin_WAYLAND_LIBS}) - if(KWIN_HAVE_EGL AND Wayland_Egl_FOUND) -@@ -537,12 +549,14 @@ elseif(KWIN_BUILD_OPENGLES) - set_target_properties(kwin PROPERTIES COMPILE_FLAGS "-DKWIN_HAVE_OPENGLES") - endif() - --kf5_add_kdeinit_executable(kwin_x11 main_x11.cpp) --target_link_libraries(kdeinit_kwin_x11 kwin) -+if(HAVE_X11) -+ kf5_add_kdeinit_executable(kwin_x11 main_x11.cpp) -+ target_link_libraries(kdeinit_kwin_x11 kwin) - --install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP ) --install(TARGETS kdeinit_kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS} ) --install(TARGETS kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS} ) -+ install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP ) -+ install(TARGETS kdeinit_kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS} ) -+ install(TARGETS kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS} ) -+endif() - - if(HAVE_WAYLAND) - kf5_add_kdeinit_executable(kwin_wayland main_wayland.cpp) --- -1.8.3.1 - diff --git a/recipes-kde/plasma/untier/kwin/kwin.bb b/recipes-kde/plasma/untier/kwin/kwin.bb index 0534a13d..e8367d9f 100644 --- a/recipes-kde/plasma/untier/kwin/kwin.bb +++ b/recipes-kde/plasma/untier/kwin/kwin.bb @@ -46,8 +46,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "543fd38ecfa2bb0a8dd251a2bbbd10bf" -SRC_URI[sha256sum] = "ccf66a4b914b2ec38f834907e610b2776c617f2725bec453d7d5faf3d2b2e8c0" +SRC_URI[md5sum] = "4cce33510b72d1f4321e529fd00bf7d4" +SRC_URI[sha256sum] = "164f6cac36e12e7aac5ae1fff2c72dc616980751d877d701dd6057d9abac6fd7" SRC_URI += "file://0001-fix-build-for-qtbase-without-session-management.patch" diff --git a/recipes-kde/plasma/untier/kwrited/kwrited.bb b/recipes-kde/plasma/untier/kwrited/kwrited.bb index bd895365..2ad05274 100644 --- a/recipes-kde/plasma/untier/kwrited/kwrited.bb +++ b/recipes-kde/plasma/untier/kwrited/kwrited.bb @@ -15,8 +15,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "258d03d6b29cf8a58758c1b80f922e31" -SRC_URI[sha256sum] = "d03cea79e0a1701157115afffcf4ee83dadccdbabe9ab71dc4ba36afb330a1bb" +SRC_URI[md5sum] = "552215ae248a4a301403b585b933a4b5" +SRC_URI[sha256sum] = "4dd1529c602330c6f2238b344bbd6e8fff5ce5b5b986e458036165fe68b66757" SRC_URI += "file://0001-fix-build-for-qtbase-without-session-management.patch" diff --git a/recipes-kde/plasma/untier/libkscreen/files/0001-fix-configuration-build-on-x-less-systems.patch b/recipes-kde/plasma/untier/libkscreen/files/0001-fix-configuration-build-on-x-less-systems.patch index b1cb739f..7b129ab7 100644 --- a/recipes-kde/plasma/untier/libkscreen/files/0001-fix-configuration-build-on-x-less-systems.patch +++ b/recipes-kde/plasma/untier/libkscreen/files/0001-fix-configuration-build-on-x-less-systems.patch @@ -1,26 +1,28 @@ -From 72341abc7360dc8b28e9f05382222a0c8f433ea7 Mon Sep 17 00:00:00 2001 +From 295235f0ab69ab218f7390e98ed12d71c0a3f757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= -Date: Tue, 27 Jan 2015 10:55:30 +0100 +Date: Tue, 28 Apr 2015 13:43:12 +0200 Subject: [PATCH] fix configuration/build on x-less systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +Upstream-Status: Inappropriate [configuration] + Signed-off-by: Andreas Müller --- - CMakeLists.txt | 11 ++++++++--- - backends/CMakeLists.txt | 6 +++--- - backends/qscreen/CMakeLists.txt | 17 ++++++++++++----- - src/CMakeLists.txt | 23 ++++++++++++++++------- - src/backendlauncher/CMakeLists.txt | 23 ++++++++++++++++------- - src/backendlauncher/backendloader.cpp | 13 +++++++++---- - 6 files changed, 64 insertions(+), 29 deletions(-) + CMakeLists.txt | 12 ++++++++---- + backends/CMakeLists.txt | 6 ++++-- + backends/qscreen/CMakeLists.txt | 5 ++++- + src/CMakeLists.txt | 5 ++++- + src/backendlauncher/CMakeLists.txt | 5 ++++- + src/backendlauncher/backendloader.cpp | 13 ++++++++++--- + 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index a915140..9bf94e6 100644 +index 7cf6a31..beb47a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -15,9 +15,6 @@ include(ECMGenerateHeaders) +@@ -15,15 +15,19 @@ include(ECMGenerateHeaders) include(FeatureSummary) include(CheckCXXCompilerFlag) @@ -29,172 +31,129 @@ index a915140..9bf94e6 100644 - find_package(XCB COMPONENTS XCB RANDR) set_package_properties(XCB PROPERTIES - TYPE OPTIONAL -@@ -31,6 +28,14 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" - PURPOSE "Required for building XRandR 1.2 backend" +- TYPE REQUIRED ++ TYPE OPTIONAL + PURPOSE "Required for building XRandR backends" ) +set(REQUIRED_QT_VERSION 5.2.0) -+if (XCB_FOUND AND X11_XCB_FOUND) -+ add_definitions(-DHAVE_X11) -+ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Gui Test X11Extras) -+else() -+ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Gui Test) ++find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Gui Test) ++if (XCB_FOUND) ++ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras) ++ add_definitions(-DHAVE_XCB) +endif() + set(KF5_VERSION ${PROJECT_VERSION}) #When we are happy with the api, we can sync with frameworks ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KSCREEN VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kscreen_version.h" diff --git a/backends/CMakeLists.txt b/backends/CMakeLists.txt -index ab160e0..611d63b 100644 +index ff5d751..5140984 100644 --- a/backends/CMakeLists.txt +++ b/backends/CMakeLists.txt -@@ -1,6 +1,6 @@ +@@ -1,4 +1,6 @@ add_subdirectory(fake) add_subdirectory(qscreen) -add_subdirectory(xrandr) --# if (XCB_FOUND AND X11_XCB_FOUND) -+if (XCB_FOUND AND X11_XCB_FOUND) +-add_subdirectory(xrandr1.1) ++if (XCB_FOUND) + add_subdirectory(xrandr) - add_subdirectory(xrandr1.1) --# endif(XCB_FOUND AND X11_XCB_FOUND) -+endif(XCB_FOUND AND X11_XCB_FOUND) ++ add_subdirectory(xrandr1.1) ++endif() diff --git a/backends/qscreen/CMakeLists.txt b/backends/qscreen/CMakeLists.txt -index 1342d4f..ab5c4fb 100644 +index 1342d4f..1a07544 100644 --- a/backends/qscreen/CMakeLists.txt +++ b/backends/qscreen/CMakeLists.txt -@@ -12,10 +12,17 @@ set(qscreen_SRCS - add_library(KSC_QScreen MODULE ${qscreen_SRCS}) - +@@ -14,8 +14,11 @@ add_library(KSC_QScreen MODULE ${qscreen_SRCS}) set_target_properties(KSC_QScreen PROPERTIES PREFIX "") --target_link_libraries(KSC_QScreen Qt5::Core -- Qt5::Gui + target_link_libraries(KSC_QScreen Qt5::Core + Qt5::Gui - Qt5::X11Extras -- KF5::Screen --) -+if (XCB_FOUND AND X11_XCB_FOUND) -+ target_link_libraries(KSC_QScreen Qt5::Core -+ Qt5::Gui -+ Qt5::X11Extras -+ KF5::Screen -+ ) -+else() -+ target_link_libraries(KSC_QScreen Qt5::Core -+ Qt5::Gui -+ KF5::Screen -+ ) -+endif() + KF5::Screen + ) ++if (XCB_FOUND) ++ target_link_libraries(KSC_QScreen Qt5::X11Extras) ++endif() ++ install(TARGETS KSC_QScreen DESTINATION ${PLUGIN_INSTALL_DIR}/kf5/kscreen/) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 3b73de5..079f28c 100644 +index 3b73de5..d496140 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -24,13 +24,22 @@ qt5_add_dbus_interface(libkscreen_SRCS ${CMAKE_SOURCE_DIR}/interfaces/org.kde.KS - - add_library(KF5Screen SHARED ${libkscreen_SRCS}) - --target_link_libraries(KF5Screen -- PUBLIC -- Qt5::Core -- PRIVATE -- Qt5::DBus +@@ -29,9 +29,12 @@ target_link_libraries(KF5Screen + Qt5::Core + PRIVATE + Qt5::DBus - Qt5::X11Extras --) -+if (XCB_FOUND AND X11_XCB_FOUND) -+ target_link_libraries(KF5Screen -+ PUBLIC -+ Qt5::Core -+ PRIVATE -+ Qt5::DBus -+ Qt5::X11Extras -+ ) -+else() -+ target_link_libraries(KF5Screen -+ PUBLIC -+ Qt5::Core -+ PRIVATE -+ Qt5::DBus -+ ) -+endif() + ) ++if (XCB_FOUND) ++ target_link_libraries(KF5Screen PRIVATE Qt5::X11Extras) ++endif() ++ set_target_properties(KF5Screen PROPERTIES VERSION "${KSCREEN_VERSION_STRING}" + SOVERSION "${KSCREEN_SOVERSION}" diff --git a/src/backendlauncher/CMakeLists.txt b/src/backendlauncher/CMakeLists.txt -index de73ae1..94d1f16 100644 +index de73ae1..ddf631f 100644 --- a/src/backendlauncher/CMakeLists.txt +++ b/src/backendlauncher/CMakeLists.txt -@@ -14,12 +14,21 @@ qt5_add_dbus_adaptor(backendlauncher_SRCS ${CMAKE_SOURCE_DIR}/interfaces/org.kde - - add_executable(kscreen_backend_launcher ${backendlauncher_SRCS}) - --target_link_libraries(kscreen_backend_launcher -- KF5Screen -- Qt5::Core -- Qt5::Gui +@@ -18,8 +18,11 @@ target_link_libraries(kscreen_backend_launcher + KF5Screen + Qt5::Core + Qt5::Gui - Qt5::X11Extras -- Qt5::DBus --) -+if (XCB_FOUND AND X11_XCB_FOUND) -+ target_link_libraries(kscreen_backend_launcher -+ KF5Screen -+ Qt5::Core -+ Qt5::Gui -+ Qt5::X11Extras -+ Qt5::DBus -+ ) -+else() -+ target_link_libraries(kscreen_backend_launcher -+ KF5Screen -+ Qt5::Core -+ Qt5::Gui -+ Qt5::DBus -+ ) -+endif() + Qt5::DBus + ) ++if (XCB_FOUND) ++ target_link_libraries(kscreen_backend_launcher Qt5::X11Extras) ++endif() ++ install(TARGETS kscreen_backend_launcher DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR_KF5}) diff --git a/src/backendlauncher/backendloader.cpp b/src/backendlauncher/backendloader.cpp -index 7b90745..9278f9c 100644 +index 32a4a2b..b369ac7 100644 --- a/src/backendlauncher/backendloader.cpp +++ b/src/backendlauncher/backendloader.cpp @@ -24,8 +24,9 @@ #include #include #include -+#ifdef HAVE_X11 ++#ifdef HAVE_XCB #include - +#endif #include #include -@@ -58,6 +59,7 @@ bool BackendLoader::loadBackend(const QString& backend) +@@ -60,6 +61,7 @@ bool BackendLoader::loadBackend(const QString& backend) continue; } -+#ifdef HAVE_X11 ++#ifdef HAVE_XCB // When on X11, skip the QScreen backend, instead use the XRandR backend, // if not specified in KSCREEN_BACKEND if (backend.isEmpty() && -@@ -65,12 +67,15 @@ bool BackendLoader::loadBackend(const QString& backend) +@@ -67,12 +69,17 @@ bool BackendLoader::loadBackend(const QString& backend) QX11Info::isPlatformX11()) { continue; } -- +#endif + // When not on X11, skip the XRandR backend, and fall back to QSCreen // if not specified in KSCREEN_BACKEND if (backend.isEmpty() && - finfo.fileName().contains(QLatin1String("KSC_XRandR")) && - !QX11Info::isPlatformX11()) { -+ finfo.fileName().contains(QLatin1String("KSC_XRandR")) -+#ifdef HAVE_X11 ++ finfo.fileName().contains(QLatin1String("KSC_XRandR")) ++#ifdef HAVE_XCB + && !QX11Info::isPlatformX11() +#endif -+ ) { ++ ) { ++ continue; } -- -1.8.3.1 +1.9.3 diff --git a/recipes-kde/plasma/untier/libkscreen/libkscreen.bb b/recipes-kde/plasma/untier/libkscreen/libkscreen.bb index 87fb82df..67e11e72 100644 --- a/recipes-kde/plasma/untier/libkscreen/libkscreen.bb +++ b/recipes-kde/plasma/untier/libkscreen/libkscreen.bb @@ -13,8 +13,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "0dd314fefd799c066488769717ed52f1" -SRC_URI[sha256sum] = "7ea64d6a591fa907d0569d73e2159e120341b47253d0d3ecb9f0ceb33c9aac7a" +SRC_URI[md5sum] = "13475823e0a69ec263b284e1fd65b0c3" +SRC_URI[sha256sum] = "4dd23d72d0fa54cfaa23d62c93ab0a01ad75c4d7023895b23a47c450e890afc1" SRC_URI += " \ file://0001-fix-configuration-build-on-x-less-systems.patch \ diff --git a/recipes-kde/plasma/untier/libksysguard/libksysguard.bb b/recipes-kde/plasma/untier/libksysguard/libksysguard.bb index a45ecabc..6fbe8a83 100644 --- a/recipes-kde/plasma/untier/libksysguard/libksysguard.bb +++ b/recipes-kde/plasma/untier/libksysguard/libksysguard.bb @@ -25,8 +25,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "a7e74e6d45c40cfa22da997141793968" -SRC_URI[sha256sum] = "5b554700e004e8baae4df79b4e95f10c53994e5dcd4cb2bb02cdc0c818a6415d" +SRC_URI[md5sum] = "0f05db8ce605f62657354449b79fa12c" +SRC_URI[sha256sum] = "9b083b54951e5ac3aa638cccf1a54f720566c18f30a4cc20b7a3ac5067ee6899" # cross libs / headers CMAKE_ALIGN_SYSROOT[1] = "KF5SysGuard, -S${libdir}/lib, -S${STAGING_LIBDIR}/lib" diff --git a/recipes-kde/plasma/untier/milou/milou.bb b/recipes-kde/plasma/untier/milou/milou.bb index 7d1e2134..03987ce0 100644 --- a/recipes-kde/plasma/untier/milou/milou.bb +++ b/recipes-kde/plasma/untier/milou/milou.bb @@ -19,8 +19,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "b1a618f3887ee6b0ebe5edf5568a6261" -SRC_URI[sha256sum] = "d9fd5bc3a438affec9d4cc786a03929c7ed379d6cac22a920f1d9b0812d8e048" +SRC_URI[md5sum] = "b333e81ca010332df095286f353ede9f" +SRC_URI[sha256sum] = "5857081b91a6537d110608901b4eac4b0e8aa627f608a8b4d243f1c86fdf2d21" FILES_${PN} += " \ ${datadir}/k*5 \ diff --git a/recipes-kde/plasma/untier/muon/muon.bb b/recipes-kde/plasma/untier/muon/muon.bb index 6f43fd23..d12ce99b 100644 --- a/recipes-kde/plasma/untier/muon/muon.bb +++ b/recipes-kde/plasma/untier/muon/muon.bb @@ -27,8 +27,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "842a75bd7614fb4f8a7003f0f49046fa" -SRC_URI[sha256sum] = "289979be6c918576c1ca2abbe90fea5b7339d5ee082a65d8ce3599ee40e4005b" +SRC_URI[md5sum] = "c2d29016945ab4a87a6e9b80099b7d0e" +SRC_URI[sha256sum] = "196c63d899ac9399993e3353d630b769d965ec1d0fa884028dd70277c5b52b39" FILES_SOLIBSDEV = "${libdir}/libmuonprivate${SOLIBSDEV}" @@ -41,6 +41,7 @@ FILES_${PN} += " \ ${datadir}/desktoptheme \ ${datadir}/muonabstractnotifier \ \ + ${libdir}/libMuonCommon.so \ ${libdir}/libMuonNotifiers.so \ ${libdir}/plugins \ ${libdir}/qml \ diff --git a/recipes-kde/plasma/untier/oxygen-fonts/oxygen-fonts.bb b/recipes-kde/plasma/untier/oxygen-fonts/oxygen-fonts.bb index 234ea556..ff170eaf 100644 --- a/recipes-kde/plasma/untier/oxygen-fonts/oxygen-fonts.bb +++ b/recipes-kde/plasma/untier/oxygen-fonts/oxygen-fonts.bb @@ -11,8 +11,8 @@ inherit kde-plasma DEPENDS += "fontforge-native" PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "76d0d925bcc0b0df7475246914e2d47d" -SRC_URI[sha256sum] = "202d78eead03dac9ffc2717dda05ebed8cf2f5b71c04a1360cff9722c4833ff7" +SRC_URI[md5sum] = "1899f95757694bf849ff0661797e09d2" +SRC_URI[sha256sum] = "9ea4aa8c5488ab069e3d16e70a26fb8f9e3be1af2c2e67080b82ac5243b23872" EXTRA_OECMAKE += "-DOXYGEN_FONT_INSTALL_DIR=${datadir}/fonts/truetype/oxygen" diff --git a/recipes-kde/plasma/untier/oxygen/oxygen.bb b/recipes-kde/plasma/untier/oxygen/oxygen.bb index 6d90e1f0..8e230caa 100644 --- a/recipes-kde/plasma/untier/oxygen/oxygen.bb +++ b/recipes-kde/plasma/untier/oxygen/oxygen.bb @@ -20,11 +20,12 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "0caa3195658000ad8ac06e63d935ac6d" -SRC_URI[sha256sum] = "f54f2971f750dd941e9208e690f64dde91b59024c891ccfdf5abea45af0075c2" +SRC_URI[md5sum] = "e1ffcc826eb9de168b68d7f2244df510" +SRC_URI[sha256sum] = "e3d8d37e4178b00324a99a04b0a40b6c4544f913d2887727cda6047599fda528" FILES_${PN} += " \ ${datadir}/icons \ + ${datadir}/kservices5 \ ${datadir}/kstyle \ ${datadir}/plasma \ ${libdir}/plugins \ diff --git a/recipes-kde/plasma/untier/plasma-desktop/files/0001-fix-path-to-fontinst.patch b/recipes-kde/plasma/untier/plasma-desktop/files/0001-fix-path-to-fontinst.patch index 40a7a103..70b07cef 100644 --- a/recipes-kde/plasma/untier/plasma-desktop/files/0001-fix-path-to-fontinst.patch +++ b/recipes-kde/plasma/untier/plasma-desktop/files/0001-fix-path-to-fontinst.patch @@ -22,8 +22,8 @@ index f2e6014..53961fb 100644 #ifndef __CONFIG_FONTINST_H__ #define __CONFIG_FONTINST_H__ --#define KFONTINST_LIB_EXEC_DIR "@CMAKE_INSTALL_PREFIX@/@KAUTH_HELPER_INSTALL_DIR@" -+#define KFONTINST_LIB_EXEC_DIR "@KAUTH_HELPER_INSTALL_DIR@" +-#define KFONTINST_LIB_EXEC_DIR "${CMAKE_INSTALL_PREFIX}/${KAUTH_HELPER_INSTALL_DIR}" ++#define KFONTINST_LIB_EXEC_DIR "${KAUTH_HELPER_INSTALL_DIR}" /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H 1 diff --git a/recipes-kde/plasma/untier/plasma-desktop/plasma-desktop.bb b/recipes-kde/plasma/untier/plasma-desktop/plasma-desktop.bb index 3648cc2b..654ae2d4 100644 --- a/recipes-kde/plasma/untier/plasma-desktop/plasma-desktop.bb +++ b/recipes-kde/plasma/untier/plasma-desktop/plasma-desktop.bb @@ -29,6 +29,7 @@ DEPENDS += " \ kitemmodels \ kemoticons \ baloo \ + kpeople \ \ ${@bb.utils.contains("DISTRO_FEATURES", "x11", "virtual/xserver libxcb qtx11extras", "", d)} \ " @@ -41,8 +42,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "dc5e656b26d31bda9d0504b3df2a5b18" -SRC_URI[sha256sum] = "d44b0eb0f59d8f2fba827418202e12fb12e0aab02c6608823085574c5a68f113" +SRC_URI[md5sum] = "3f2b87f8b1d61dd06fd882a6576f4047" +SRC_URI[sha256sum] = "376112701ee3ad29d9b5701887e5e1eb79b06e5ad3a0f1cdf3792f16eed01939" SRC_URI += "file://0001-fix-path-to-fontinst.patch" diff --git a/recipes-kde/plasma/untier/plasma-nm/files/0001-Adapt-to-modemmanager-qt-API-changes.patch b/recipes-kde/plasma/untier/plasma-nm/files/0001-Adapt-to-modemmanager-qt-API-changes.patch deleted file mode 100644 index f34d3607..00000000 --- a/recipes-kde/plasma/untier/plasma-nm/files/0001-Adapt-to-modemmanager-qt-API-changes.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 4d72cb7966edda33bc72c77fc2a126844fc1f134 Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Tue, 31 Mar 2015 14:37:16 +0200 -Subject: [PATCH] Adapt to modemmanager-qt API changes - -Upstream-Status: Backport [1] - -[1] http://quickgit.kde.org/?p=plasma-nm.git&a=commitdiff&h=4d72cb7966edda33bc72c77fc2a126844fc1f134 ---- - libs/models/networkmodel.cpp | 16 ++++++++-------- - libs/models/networkmodel.h | 4 ++-- - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/libs/models/networkmodel.cpp b/libs/models/networkmodel.cpp -index 536fdce..448ac3c 100644 ---- a/libs/models/networkmodel.cpp -+++ b/libs/models/networkmodel.cpp -@@ -246,10 +246,10 @@ void NetworkModel::initializeSignals(const NetworkManager::Device::Ptr& device) - if (modem->hasInterface(ModemManager::ModemDevice::ModemInterface)) { - ModemManager::Modem::Ptr modemNetwork = modem->interface(ModemManager::ModemDevice::ModemInterface).objectCast(); - if (modemNetwork) { -- connect(modemNetwork.data(), SIGNAL(signalQualityChanged(uint)), -- SLOT(gsmNetworkSignalQualityChanged(uint)), Qt::UniqueConnection); -- connect(modemNetwork.data(), SIGNAL(accessTechnologyChanged(ModemManager::Modem::AccessTechnologies)), -- SLOT(gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies)), Qt::UniqueConnection); -+ connect(modemNetwork.data(), SIGNAL(signalQualityChanged(ModemManager::SignalQualityPair)), -+ SLOT(gsmNetworkSignalQualityChanged(ModemManager::SignalQualityPair)), Qt::UniqueConnection); -+ connect(modemNetwork.data(), SIGNAL(accessTechnologiesChanged(QFlags)), -+ SLOT(gsmNetworkAccessTechnologiesChanged(QFlags)), Qt::UniqueConnection); - connect(modemNetwork.data(), SIGNAL(currentModesChanged()), - SLOT(gsmNetworkCurrentModesChanged()), Qt::UniqueConnection); - } -@@ -847,9 +847,9 @@ void NetworkModel::deviceStateChanged(NetworkManager::Device::State state, Netwo - } - - #if WITH_MODEMMANAGER_SUPPORT --void NetworkModel::gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies technology) -+void NetworkModel::gsmNetworkAccessTechnologiesChanged(QFlags accessTechnologies) - { -- Q_UNUSED(technology); -+ Q_UNUSED(accessTechnologies); - ModemManager::Modem * gsmNetwork = qobject_cast(sender()); - if (gsmNetwork) { - Q_FOREACH (const NetworkManager::Device::Ptr & dev, NetworkManager::networkInterfaces()) { -@@ -893,7 +893,7 @@ void NetworkModel::gsmNetworkCurrentModesChanged() - } - } - --void NetworkModel::gsmNetworkSignalQualityChanged(uint signal) -+void NetworkModel::gsmNetworkSignalQualityChanged(const ModemManager::SignalQualityPair &signalQuality) - { - ModemManager::Modem * gsmNetwork = qobject_cast(sender()); - if (gsmNetwork) { -@@ -912,7 +912,7 @@ void NetworkModel::gsmNetworkSignalQualityChanged(uint signal) - ModemManager::Modem::Ptr modemNetwork = modem->interface(ModemManager::ModemDevice::ModemInterface).objectCast(); - if (modemNetwork && modemNetwork->device() == gsmNetwork->device()) { - Q_FOREACH(NetworkModelItem * item, m_list.returnItems(NetworkItemsList::Device, dev->uni())) { -- item->setSignal(signal); -+ item->setSignal(signalQuality.signal); - updateItem(item); - } - } -diff --git a/libs/models/networkmodel.h b/libs/models/networkmodel.h -index 3d100ec..d506960 100644 ---- a/libs/models/networkmodel.h -+++ b/libs/models/networkmodel.h -@@ -94,9 +94,9 @@ private Q_SLOTS: - void deviceRemoved(const QString& device); - void deviceStateChanged(NetworkManager::Device::State state, NetworkManager::Device::State oldState, NetworkManager::Device::StateChangeReason reason); - #if WITH_MODEMMANAGER_SUPPORT -- void gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies technology); -+ void gsmNetworkAccessTechnologiesChanged(QFlags accessTechnologies); - void gsmNetworkCurrentModesChanged(); -- void gsmNetworkSignalQualityChanged(uint signal); -+ void gsmNetworkSignalQualityChanged(const ModemManager::SignalQualityPair &signalQuality); - #endif - void ipConfigChanged(); - void ipInterfaceChanged(); --- -1.9.3 - diff --git a/recipes-kde/plasma/untier/plasma-nm/plasma-nm.bb b/recipes-kde/plasma/untier/plasma-nm/plasma-nm.bb index f58814cd..3c78d468 100644 --- a/recipes-kde/plasma/untier/plasma-nm/plasma-nm.bb +++ b/recipes-kde/plasma/untier/plasma-nm/plasma-nm.bb @@ -40,9 +40,8 @@ DEPENDS += " \ # MobileBroadbandProviderInfo PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "296b78fb6b84f80441f6144b11a5d6a5" -SRC_URI[sha256sum] = "4def5df2fa1d5def34c9085d11dea3e08b2a7fa0994ffe61165b14b34ea26180" -SRC_URI += "file://0001-Adapt-to-modemmanager-qt-API-changes.patch" +SRC_URI[md5sum] = "7bee8712c848e467ad23856ed6b89b9e" +SRC_URI[sha256sum] = "2a7b31a0b6a69ba062fb96702dd7215b4d2a44bede93d909853a8c915b968dfe" # do not move so-libs to -dev package FILES_SOLIBSDEV = "" diff --git a/recipes-kde/plasma/untier/plasma-workspace-wallpapers/plasma-workspace-wallpapers.bb b/recipes-kde/plasma/untier/plasma-workspace-wallpapers/plasma-workspace-wallpapers.bb index ce8e8dd1..aeff93e8 100644 --- a/recipes-kde/plasma/untier/plasma-workspace-wallpapers/plasma-workspace-wallpapers.bb +++ b/recipes-kde/plasma/untier/plasma-workspace-wallpapers/plasma-workspace-wallpapers.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = " \ inherit kde-plasma PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "8c70b41f3310aabdf719d3438498a26e" -SRC_URI[sha256sum] = "97d66cce48114ff4ba2da8cc90aff4df0cd60ff51c615f357665be4a160b5c96" +SRC_URI[md5sum] = "c11a60c69784c57c03f841c03fa966c9" +SRC_URI[sha256sum] = "4ada62b8f33cf70ebf53ba3cc67177eebd8980da3f883247ea4498428823914d" FILES_${PN} += "${datadir}/wallpapers" diff --git a/recipes-kde/plasma/untier/polkit-kde-agent-1/polkit-kde-agent-1.bb b/recipes-kde/plasma/untier/polkit-kde-agent-1/polkit-kde-agent-1.bb index 3b121eda..e272a608 100644 --- a/recipes-kde/plasma/untier/polkit-kde-agent-1/polkit-kde-agent-1.bb +++ b/recipes-kde/plasma/untier/polkit-kde-agent-1/polkit-kde-agent-1.bb @@ -20,8 +20,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "bf016c9827f8a6bb4bdafb46e26ebe82" -SRC_URI[sha256sum] = "f80021aa5ecab11ab1363fa459e30d13a425e81b28060beb8e85d757d9cb79a2" +SRC_URI[md5sum] = "5978e2a9d149a4b4beb2f5954a689147" +SRC_URI[sha256sum] = "39426953445a4cbc48c88c5346097455c941648c908b0e06474154a949192c7c" SRC_URI += "file://0001-fix-build-for-QT_NO_SESSIONMANAGER.patch" diff --git a/recipes-kde/plasma/untier/powerdevil/powerdevil.bb b/recipes-kde/plasma/untier/powerdevil/powerdevil.bb index d3bcfdd4..e99907aa 100644 --- a/recipes-kde/plasma/untier/powerdevil/powerdevil.bb +++ b/recipes-kde/plasma/untier/powerdevil/powerdevil.bb @@ -23,8 +23,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "e699ac7bd905d404bacdfbf6257778d5" -SRC_URI[sha256sum] = "6dfb852c15c47f48da4708e9b93adc3fda077989bdde2a421dc04def6acfe71e" +SRC_URI[md5sum] = "ba3f8e0ca8e15c0a361d9100c52a992c" +SRC_URI[sha256sum] = "15b2f95f50288a3be3786d652ddca9ecccb734f7099e0bf78127a85cbf1f25df" FILES_${PN} += " \ ${datadir}/k*5 \ diff --git a/recipes-kde/plasma/untier/sddm-kcm/sddm-kcm.bb b/recipes-kde/plasma/untier/sddm-kcm/sddm-kcm.bb index bfda3e27..7624696e 100644 --- a/recipes-kde/plasma/untier/sddm-kcm/sddm-kcm.bb +++ b/recipes-kde/plasma/untier/sddm-kcm/sddm-kcm.bb @@ -19,8 +19,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "8eb5551cfee71f36fdffec76d36aa5e6" -SRC_URI[sha256sum] = "79da669c38858da4595fa5a66a4d28c2f2b4170679e58b61a9278010f474eaf2" +SRC_URI[md5sum] = "1bd06777f1f0bbf212397f44d64f5c53" +SRC_URI[sha256sum] = "8cf1efef36bd021da77ab39a5ef250d42dc04bbecda3343e61b65dfa4d53a097" FILES_${PN} += " \ ${datadir}/kservices5 \ diff --git a/recipes-kde/plasma/untier/systemsettings/systemsettings.bb b/recipes-kde/plasma/untier/systemsettings/systemsettings.bb index 81b9e979..82e35894 100644 --- a/recipes-kde/plasma/untier/systemsettings/systemsettings.bb +++ b/recipes-kde/plasma/untier/systemsettings/systemsettings.bb @@ -23,8 +23,8 @@ DEPENDS += " \ " PV = "${PLASMA_VERSION}" -SRC_URI[md5sum] = "8bc8d24c72ad22ef7660abae217e4318" -SRC_URI[sha256sum] = "9f91cc2aac47acf194be5c5749b7267a1d368e245d9309dcf305eea6b23e4124" +SRC_URI[md5sum] = "75daff0dd6fdc89391b35a1bacba43ce" +SRC_URI[sha256sum] = "701bf4a62c55dafcd9994d9e193c0895b7d531422f674b5548a664435aaad067" FILES_${PN} += " \ ${datadir}/k*5 \