Drop X11 connection getters in Effect

They are redundant, EffectsHandler already provides same things.
This commit is contained in:
Vlad Zahorodnii 2023-11-15 10:41:40 +02:00
parent a5546f1450
commit d0158ec588
4 changed files with 2 additions and 17 deletions

View file

@ -497,16 +497,6 @@ int Effect::requestedEffectChainPosition() const
return 0;
}
xcb_connection_t *Effect::xcbConnection() const
{
return effects->xcbConnection();
}
xcb_window_t Effect::x11RootWindow() const
{
return effects->x11RootWindow();
}
bool Effect::touchDown(qint32 id, const QPointF &pos, std::chrono::microseconds time)
{
return false;

View file

@ -16,8 +16,6 @@
#include <KPluginFactory>
#include <KSharedConfig>
#include <xcb/xcb.h> // FIXME: drop it
class QKeyEvent;
class QTabletEvent;
@ -928,9 +926,6 @@ public Q_SLOTS:
virtual bool borderActivated(ElectricBorder border);
protected:
xcb_connection_t *xcbConnection() const;
xcb_window_t x11RootWindow() const;
/**
* An implementing class can call this with it's kconfig compiled singleton class.
* This method will perform the instance on the class.

View file

@ -202,7 +202,7 @@ void KscreenEffect::switchState(ScreenState &state)
value = 0l;
}
if (value != -1l && m_atom != XCB_ATOM_NONE) {
xcb_change_property(xcbConnection(), XCB_PROP_MODE_REPLACE, x11RootWindow(), m_atom, XCB_ATOM_CARDINAL, 32, 1, &value);
xcb_change_property(effects->xcbConnection(), XCB_PROP_MODE_REPLACE, effects->x11RootWindow(), m_atom, XCB_ATOM_CARDINAL, 32, 1, &value);
}
}

View file

@ -82,7 +82,7 @@ StartupFeedbackEffect::StartupFeedbackEffect()
{
// TODO: move somewhere that is x11-specific
if (KWindowSystem::isPlatformX11()) {
m_selection = new KSelectionOwner("_KDE_STARTUP_FEEDBACK", xcbConnection(), x11RootWindow(), this);
m_selection = new KSelectionOwner("_KDE_STARTUP_FEEDBACK", effects->xcbConnection(), effects->x11RootWindow(), this);
m_selection->claim(true);
}
connect(m_startupInfo, &KStartupInfo::gotNewStartup, this, [](const KStartupInfoId &id, const KStartupInfoData &data) {