From 7d088288c2284310af1180f54c37cc3bfe536686 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 31 Jul 2023 08:26:30 +0000 Subject: [PATCH] kdeui: remove redundant X11 atoms creation from KApplicationPrivate::init() XdndDrop is already created by QApplication for internal purposes, KDE_DESKTOP_WINDOW is a bogus one Signed-off-by: Ivailo Monev --- kdeui/kernel/kapplication.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/kdeui/kernel/kapplication.cpp b/kdeui/kernel/kapplication.cpp index 05d27769..9a7a9ced 100644 --- a/kdeui/kernel/kapplication.cpp +++ b/kdeui/kernel/kapplication.cpp @@ -78,9 +78,7 @@ KApplication* KApplication::KApp = 0L; #ifdef Q_WS_X11 -static Atom atom_DesktopWindow = None; static Atom atom_NetSupported = None; -static Atom kde_xdnd_drop = None; static QByteArray* startup_id_tmp = nullptr; #endif @@ -385,31 +383,10 @@ void KApplicationPrivate::init() (void) QApplication::clipboard(); parseCommandLine(); - #ifdef Q_WS_X11 - // create all required atoms in _one_ roundtrip to the X server - const int max = 20; - Atom* atoms[max]; - char* names[max]; - Atom atoms_return[max]; - int n = 0; - - atoms[n] = &atom_DesktopWindow; - names[n++] = (char *) "KDE_DESKTOP_WINDOW"; - - atoms[n] = &atom_NetSupported; - names[n++] = (char *) "_NET_SUPPORTED"; - - atoms[n] = &kde_xdnd_drop; - names[n++] = (char *) "XdndDrop"; - - XInternAtoms( QX11Info::display(), names, n, false, atoms_return ); - - for (int i = 0; i < n; i++ ) - *atoms[i] = atoms_return[i]; + atom_NetSupported = XInternAtom( QX11Info::display(), "_NET_SUPPORTED", False ); #endif - // sanity checking, to make sure we've connected QDBusConnection sessionBus = QDBusConnection::sessionBus(); QDBusConnectionInterface *bus = 0;