From 198625f679aabbe25097884ec0029bc55e0a84b8 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 19 Aug 2023 00:16:29 +0300 Subject: [PATCH] drop startup notification support essentially non-operational for Katana applications (KApplication has a hack to steal the DESKTOP_STARTUP_ID environment variable) and it is by no means Katie's responsibility to do startup notification Signed-off-by: Ivailo Monev --- src/gui/kernel/qapplication_x11.cpp | 10 ---------- src/gui/kernel/qt_x11_p.h | 5 ----- src/gui/kernel/qwidget_p.h | 1 - src/gui/kernel/qwidget_x11.cpp | 40 ------------------------------------- 4 files changed, 56 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index c96b4b3f2..87f6ee919 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -160,9 +160,6 @@ static const char* X11AtomsTbl[QX11Data::NPredefinedAtoms] = { "_NET_WM_WINDOW_TYPE_DND\0", "_NET_WM_WINDOW_TYPE_NORMAL\0", - "_NET_STARTUP_INFO\0", - "_NET_STARTUP_INFO_BEGIN\0", - "_NET_SUPPORTING_WM_CHECK\0", "_NET_SYSTEM_TRAY_VISUAL\0", @@ -935,8 +932,6 @@ void qt_init(QApplicationPrivate *priv, Display *display, qt_x11Data->has_fontconfig = FcInit(); #endif - qt_x11Data->startupId = 0; - int argc = priv->argc; char **argv = priv->argv; @@ -1226,11 +1221,6 @@ void qt_init(QApplicationPrivate *priv, Display *display, QFont f(QFont::lastResortFamily(), ptsz); QApplicationPrivate::setSystemFont(f); } - - qt_x11Data->startupId = getenv("DESKTOP_STARTUP_ID"); - if (qt_x11Data->startupId) { - ::unsetenv("DESKTOP_STARTUP_ID"); - } } /***************************************************************************** diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 3579dabbf..184ceb9ad 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -244,8 +244,6 @@ public: bool has_fontconfig; int fc_hint_style; - char *startupId; - /* Warning: if you modify this list, modify the names of atoms in qapplication_x11.cpp as well! */ enum X11Atom { // window-manager <-> client protocols @@ -329,9 +327,6 @@ public: _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, - _NET_STARTUP_INFO, - _NET_STARTUP_INFO_BEGIN, - _NET_SUPPORTING_WM_CHECK, _NET_SYSTEM_TRAY_VISUAL, diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 71168df5b..2c4fdd71c 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -558,7 +558,6 @@ public: static QWidget *keyboardGrabber; void setWindowRole(); - void sendStartupMessage() const; void setNetWmWindowTypes(); void x11UpdateIsOpaque(); bool isBackgroundInherited() const; diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 1745eae32..8454daf97 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1948,46 +1948,6 @@ void QWidgetPrivate::show_sys() if (q->internalWinId()) XMapWindow(qt_x11Data->display, q->internalWinId()); - - // Freedesktop.org Startup Notification - if (qt_x11Data->startupId && q->isWindow()) { - sendStartupMessage(); - } -} - -/*! - \internal - Platform-specific part of QWidget::show(). -*/ - -void QWidgetPrivate::sendStartupMessage() const -{ - Q_Q(const QWidget); - - QByteArray message("remove: ID="); - message.append(qt_x11Data->startupId); - - XEvent xevent; - xevent.xclient.type = ClientMessage; - xevent.xclient.message_type = ATOM(_NET_STARTUP_INFO_BEGIN); - xevent.xclient.display = qt_x11Data->display; - xevent.xclient.window = q->internalWinId(); - xevent.xclient.format = 8; - - Window rootWindow = RootWindow(qt_x11Data->display, DefaultScreen(qt_x11Data->display)); - uint sent = 0; - uint length = message.size() + 1; - do { - if (sent == 20) - xevent.xclient.message_type = ATOM(_NET_STARTUP_INFO); - - for (uint i = 0; i < 20 && i + sent <= length; i++) - xevent.xclient.data.b[i] = message[i + sent++]; - - XSendEvent(qt_x11Data->display, rootWindow, false, PropertyChangeMask, &xevent); - } while (sent <= length); - - qt_x11Data->startupId = 0; } void QWidgetPrivate::setNetWmWindowTypes() -- 2.11.0