Commit 7d05cb7d authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Remove unused X11 kwin-specific properties

There are no seems to be any usages of these properties.
parent 1cb2d38a
......@@ -15,8 +15,7 @@ namespace KWin
{
Atoms::Atoms()
: kwin_running(QByteArrayLiteral("KWIN_RUNNING"))
, activities(QByteArrayLiteral("_KDE_NET_WM_ACTIVITIES"))
: activities(QByteArrayLiteral("_KDE_NET_WM_ACTIVITIES"))
, wm_protocols(QByteArrayLiteral("WM_PROTOCOLS"))
, wm_delete_window(QByteArrayLiteral("WM_DELETE_WINDOW"))
, wm_take_focus(QByteArrayLiteral("WM_TAKE_FOCUS"))
......@@ -53,7 +52,6 @@ Atoms::Atoms()
, kde_color_sheme(QByteArrayLiteral("_KDE_NET_WM_COLOR_SCHEME"))
, kde_skip_close_animation(QByteArrayLiteral("_KDE_NET_WM_SKIP_CLOSE_ANIMATION"))
, kde_screen_edge_show(QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"))
, kwin_dbus_service(QByteArrayLiteral("_ORG_KDE_KWIN_DBUS_SERVICE"))
, utf8_string(QByteArrayLiteral("UTF8_STRING"))
, text(QByteArrayLiteral("TEXT"))
, uri_list(QByteArrayLiteral("text/uri-list"))
......
......@@ -22,7 +22,6 @@ class KWIN_EXPORT Atoms
public:
Atoms();
Xcb::Atom kwin_running;
Xcb::Atom activities;
Xcb::Atom wm_protocols;
......@@ -62,7 +61,6 @@ public:
Xcb::Atom kde_color_sheme;
Xcb::Atom kde_skip_close_animation;
Xcb::Atom kde_screen_edge_show;
Xcb::Atom kwin_dbus_service;
Xcb::Atom utf8_string;
Xcb::Atom text;
Xcb::Atom uri_list;
......
......@@ -33,7 +33,6 @@
#endif
// Qt
#include <QDBusServiceWatcher>
#include <QOpenGLContext>
namespace KWin
......@@ -51,25 +50,9 @@ DBusInterface::DBusInterface(QObject *parent)
if (!dBusSuffix.isNull()) {
m_serviceName = m_serviceName + QLatin1Char('.') + dBusSuffix;
}
if (!dbus.registerService(m_serviceName)) {
QDBusServiceWatcher *dog = new QDBusServiceWatcher(m_serviceName, dbus, QDBusServiceWatcher::WatchForUnregistration, this);
connect(dog, &QDBusServiceWatcher::serviceUnregistered, this, &DBusInterface::becomeKWinService);
} else {
announceService();
}
dbus.registerService(m_serviceName);
dbus.connect(QString(), QStringLiteral("/KWin"), QStringLiteral("org.kde.KWin"), QStringLiteral("reloadConfig"),
Workspace::self(), SLOT(slotReloadConfig()));
connect(kwinApp(), &Application::x11ConnectionChanged, this, &DBusInterface::announceService);
}
void DBusInterface::becomeKWinService(const QString &service)
{
// TODO: this watchdog exists to make really safe that we at some point get the service
// but it's probably no longer needed since we explicitly unregister the service with the deconstructor
if (service == m_serviceName && QDBusConnection::sessionBus().registerService(m_serviceName) && sender()) {
sender()->deleteLater(); // bye doggy :'(
announceService();
}
}
DBusInterface::~DBusInterface()
......@@ -77,19 +60,6 @@ DBusInterface::~DBusInterface()
QDBusConnection::sessionBus().unregisterService(m_serviceName);
// KApplication automatically also grabs org.kde.kwin, so it's often been used externally - ensure to free it as well
QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.kwin"));
if (kwinApp()->x11Connection()) {
xcb_delete_property(kwinApp()->x11Connection(), kwinApp()->x11RootWindow(), atoms->kwin_dbus_service);
}
}
void DBusInterface::announceService()
{
if (!kwinApp()->x11Connection()) {
return;
}
const QByteArray service = m_serviceName.toUtf8();
xcb_change_property(kwinApp()->x11Connection(), XCB_PROP_MODE_REPLACE, kwinApp()->x11RootWindow(), atoms->kwin_dbus_service,
atoms->utf8_string, 8, service.size(), service.constData());
}
// wrap void methods with no arguments to Workspace
......
......@@ -86,11 +86,7 @@ public Q_SLOTS: // METHODS
*/
QVariantMap getWindowInfo(const QString &uuid);
private Q_SLOTS:
void becomeKWinService(const QString &service);
private:
void announceService();
QString m_serviceName;
QDBusMessage m_replyQueryWindowInfo;
};
......
......@@ -307,12 +307,6 @@ void Workspace::initializeX11()
// Compatibility
int32_t data = 1;
xcb_change_property(kwinApp()->x11Connection(),
XCB_PROP_MODE_APPEND,
kwinApp()->x11RootWindow(),
atoms->kwin_running,
atoms->kwin_running, 32, 1, &data);
if (kwinApp()->operationMode() == Application::OperationModeX11) {
m_wasUserInteractionFilter.reset(new WasUserInteractionX11Filter);
m_movingClientFilter.reset(new MovingClientX11Filter);
......@@ -459,10 +453,6 @@ void Workspace::cleanupX11()
RootInfo::destroy();
Xcb::Extensions::destroy();
if (xcb_connection_t *connection = kwinApp()->x11Connection()) {
xcb_delete_property(connection, kwinApp()->x11RootWindow(), atoms->kwin_running);
}
m_colorMapper.reset();
m_movingClientFilter.reset();
m_startup.reset();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment