aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <[email protected]>2016-10-20 10:57:25 +0200
committerMartin Gräßlin <[email protected]>2016-11-07 11:42:10 +0100
commit288cf06b90a21a162581b1054266e3a7819e7507 (patch)
treefb7b64ce8cae74f7ab5f58465ebc3f7c2c6cabd3
parentd9612b327cf20630893161a47d2f3cf4d109b76f (diff)
Create KSelectionOwner in StartupFeedbackEffect only on X11
Summary: On Wayland we do not need the selection. By only creating the KSelectionOwner on X11 an X11-runtime dependency is removed from the StartupFeedbackEffect. Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D3121
-rw-r--r--effects/startupfeedback/startupfeedback.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp
index a948a5f..14b5f13 100644
--- a/effects/startupfeedback/startupfeedback.cpp
+++ b/effects/startupfeedback/startupfeedback.cpp
@@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KIconLoader>
#include <KStartupInfo>
#include <KSelectionOwner>
+#include <KWindowSystem>
// KWin
#include <kwinglutils.h>
@@ -73,7 +74,7 @@ static const int s_startupDefaultTimeout = 5;
StartupFeedbackEffect::StartupFeedbackEffect()
: m_bounceSizesRatio(1.0)
, m_startupInfo(new KStartupInfo(KStartupInfo::CleanOnCantDetect, this))
- , m_selection(new KSelectionOwner("_KDE_STARTUP_FEEDBACK", xcbConnection(), x11RootWindow(), this))
+ , m_selection(nullptr)
, m_active(false)
, m_frame(0)
, m_progress(0)
@@ -85,7 +86,10 @@ StartupFeedbackEffect::StartupFeedbackEffect()
for (int i = 0; i < 5; ++i) {
m_bouncingTextures[i] = 0;
}
- m_selection->claim(true);
+ if (KWindowSystem::isPlatformX11()) {
+ m_selection = new KSelectionOwner("_KDE_STARTUP_FEEDBACK", xcbConnection(), x11RootWindow(), this);
+ m_selection->claim(true);
+ }
connect(m_startupInfo, SIGNAL(gotNewStartup(KStartupInfoId,KStartupInfoData)), SLOT(gotNewStartup(KStartupInfoId,KStartupInfoData)));
connect(m_startupInfo, SIGNAL(gotRemoveStartup(KStartupInfoId,KStartupInfoData)), SLOT(gotRemoveStartup(KStartupInfoId,KStartupInfoData)));
connect(m_startupInfo, SIGNAL(gotStartupChange(KStartupInfoId,KStartupInfoData)), SLOT(gotStartupChange(KStartupInfoId,KStartupInfoData)));